1
2 %% Support macros for LaTeX documentation generated by ocamldoc.
3 %% This file is in the public domain; do what you want with it.
4
5 \NeedsTeXFormat{LaTeX2e}
6 \ProvidesPackage{ocamldoc}
7 [2001/12/04 v1.0 ocamldoc support]
8
9 \newenvironment{ocamldoccode}{%
10 \bgroup
11 \leftskip\@totalleftmargin
12 \rightskip\z@skip
13 \parindent\z@
14 \parfillskip\@flushglue
15 \parskip\z@skip
16 %\noindent
17 \@@par\smallskip
18 \@tempswafalse
19 \def\par{%
20 \if@tempswa
21 \leavevmode\null\@@par\penalty\interlinepenalty
22 \else
23 \@tempswatrue
24 \ifhmode\@@par\penalty\interlinepenalty\fi
25 \fi}
26 \obeylines
27 \verbatim@font
28 \let\org@prime~%
29 \@noligs
30 \let\org@dospecials\dospecials
31 \g@remfrom@specials{\\}
32 \g@remfrom@specials{\{}
33 \g@remfrom@specials{\}}
34 \let\do\@makeother
35 \dospecials
36 \let\dospecials\org@dospecials
37 \frenchspacing\@vobeyspaces
38 \everypar \expandafter{\the\everypar \unpenalty}}
39 {\egroup\par}
40
41 \def\g@remfrom@specials#1{%
42 \def\@new@specials{}
43 \def\@remove##1{%
44 \ifx##1#1\else
45 \g@addto@macro\@new@specials{\do ##1}\fi}
46 \let\do\@remove\dospecials
47 \let\dospecials\@new@specials
48 }
49
50 \newenvironment{ocamldocdescription}
51 {\list{}{\rightmargin0pt \topsep0pt}\raggedright\item\noindent\relax\ignorespaces}
52 {\endlist\medskip}
53
54 \newenvironment{ocamldoccomment}
55 {\list{}{\leftmargin 2\leftmargini \rightmargin0pt \topsep0pt}\raggedright\item\noindent\relax}
56 {\endlist}
57
58 \let \ocamldocparagraph \paragraph
59 \def \paragraph #1{\ocamldocparagraph {#1}\noindent}
60 \let \ocamldocsubparagraph \subparagraph
61 \def \subparagraph #1{\ocamldocsubparagraph {#1}\noindent}
62
63 \let\ocamldocvspace\vspace
64
65 \newenvironment{ocamldocindent}{\list{}{}\item\relax}{\endlist}
66 \newenvironment{ocamldocsigend}
67 {\noindent\quad\texttt{sig}\ocamldocindent}
68 {\endocamldocindent\vskip -\lastskip
69 \noindent\quad\texttt{end}\medskip}
70 \newenvironment{ocamldocobjectend}
71 {\noindent\quad\texttt{object}\ocamldocindent}
72 {\endocamldocindent\vskip -\lastskip
73 \noindent\quad\texttt{end}\medskip}
74
75 \endinput
76