blob: 9118ef5e5bfadf0becc529d0eb686341af617626 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
|
\makeatletter
% Pour hevea
\newif\ifouthtml\outhtmlfalse
\newcommand{\cutname}[1]{}
% Notations pour les metavariables
\def\var#1{{\it#1}}
\def\nth#1#2{${\it#1}_{#2}$}
\def\nmth#1#2#3{${\it#1}_{#2}^{#3}$}
\def\optvar#1{\textrm{[}\var{#1}\/\textrm{]}}
\def\event{$\bowtie$}
\def\fromoneto#1#2{$#1 = 1, \ldots, #2$}
% Redefining sections macros to make label mandatory
\let\@oldsection=\section
\let\@oldsubsection=\subsection
\let\@oldsubsubsection=\subsection
\newcommand{\ocamldocinputstart}{
\let\section=\@oldsection
\let\subsection=\@oldsubsection
\let\subsubsection=\@oldsubsubsection
}
\renewcommand{\section}{\@ifstar{\@lsectionstar}{\@lsection}}
\renewcommand{\subsection}{\@ifstar{\@lsubsectionstar}{\@lsubsection}}
\renewcommand{\subsubsection}{\@ifstar{\@lsubsubsectionstar}{\@lsubsubsection}}
\newcommand{\@lsection}[2]{\@oldsection{\label{#1}#2}}
\newcommand{\@lsectionstar}[2]{\@oldsection*{\label{#1}#2}}
\newcommand{\@lsubsection}[2]{\@oldsubsection{\label{#1}#2}}
\newcommand{\@lsubsectionstar}[2]{\@oldsubsection*{\label{#1}#2}}
\newcommand{\@lsubsubsection}[2]{\@oldsubsubsection{\label{#1}#2}}
\newcommand{\@lsubsubsectionstar}[2]{\@oldsubsubsection*{\label{#1}#2}}
\newcommand{\lparagraph}[2]{\paragraph{\label{#1}#2}}
% Numerotation
\setcounter{secnumdepth}{2} % Pour numeroter les \subsection
\setcounter{tocdepth}{1} % Pour ne pas mettre les \subsection
% dans la table des matieres
\def\ttstretch{\tt\spaceskip=5.77pt plus 1.83pt minus 1.22pt}
% La fonte cmr10 a normalement des espaces de 5.25pt non extensibles.
% En 11 pt ca fait 5.77 pt. On lui ajoute la meme flexibilite que
% cmr10 agrandie a 11 pt.
% Pour la traduction "xxxx" -> {\machine{xxxx}} faite par texquote2
\def\machine#1{\mbox{\ttstretch{#1}}}
% Pour la traduction "\begin{verbatim}...\end{verbatim}"
% -> "\begin{machineenv}...\end{machineenv}"
% faite aussi par texquote2.
\newenvironment{machineenv}{\alltt}{\endalltt}
% Environnements
\newlength{\versionwidth}
\setbox0=\hbox{\bf Windows:} \setlength{\versionwidth}{\wd0}
\def\versionspecific#1{
\begin{description}\item[#1:]~\\}
\def\unix{\versionspecific{Unix}}
\def\endunix{\end{description}}
\def\windows{\versionspecific{Windows}}
\def\endwindows{\end{description}}
\def\requirements{\trivlist \item[\hskip\labelsep {\bf Requirements.}]}
\def\endrequirements{\endtrivlist}
\def\installation{\trivlist \item[\hskip\labelsep {\bf Installation.}]}
\def\endinstallation{\endtrivlist}
\def\troubleshooting{\trivlist \item[\hskip\labelsep {\bf Troubleshooting.}]}
\def\endtroubleshooting{\endtrivlist}
\newtheorem{gcrule}{Rule}
% Pour les tables de priorites et autres tableaux a deux colonnes, encadres
\def\tableau#1#2#3{%
\begin{center}
\begin{tabular}{#1}
\hline
#2 & #3 \\
\hline
}
\def\endtableau{\hline\end{tabular}\end{center}}
\def\entree#1#2{#1 & #2 \\}
% L'environnement option
\def\optionitem[#1]{\if@noparitem \@donoparitem
\else \if@inlabel \indent \par \fi
\ifhmode \unskip\unskip \par \fi
\if@newlist \if@nobreak \@nbitem \else
\addpenalty\@beginparpenalty
\addvspace\@topsep \addvspace{-\parskip}\fi
\else \addpenalty\@itempenalty \addvspace\itemsep
\fi
\global\@inlabeltrue
\fi
\everypar{\global\@minipagefalse\global\@newlistfalse
\if@inlabel\global\@inlabelfalse \hskip -\parindent \box\@labels
\penalty\z@ \fi
\everypar{}}\global\@nobreakfalse
\if@noitemarg \@noitemargfalse \if@nmbrlist \refstepcounter{\@listctr}\fi \fi
\setbox\@tempboxa\hbox{\makelabel{#1}}%
\global\setbox\@labels
\ifdim \wd\@tempboxa >\labelwidth
\hbox{\unhbox\@labels
\hskip -\leftmargin
\box\@tempboxa}\hfil\break
\else
\hbox{\unhbox\@labels
\hskip -\leftmargin
\hbox to\leftmargin {\makelabel{#1}\hfil}}
\fi
\ignorespaces}
\def\optionlabel#1{\bf #1}
\def\options{\list{}{\let\makelabel\optionlabel\let\@item\optionitem}}
\def\endoptions{\endlist}
% L'environnement library (pour composer les descriptions des modules
% de bibliotheque).
\def\comment{\penalty200\list{}{}\item[]}
\def\endcomment{\endlist\penalty-100}
\def\library{
\begingroup
\raggedright
\let\@savedlistI=\@listI%
\def\@listI{\leftmargin\leftmargini\parsep 0pt plus 1pt\topsep 0pt plus 2pt}%
\itemsep 0pt
\topsep 0pt plus 2pt
\partopsep 0pt
}
\def\endlibrary{
\endgroup
}
\def\restoreindent{\begingroup\let\@listI=\@savedlistI}
\def\endrestoreindent{\endgroup}
% ^^A...^^A: compose l'interieur en \tt, comme \verb
\catcode`\^^A=\active
\def{%
\begingroup\catcode``=13\@noligs\ttstretch\let\do\@makeother\dospecials%
\def\@xobeysp{\leavevmode\penalty100\ }%
\@vobeyspaces\frenchspacing\catcode`\^^A=\active\def{\endgroup}}
% Pour l'index
\let\indexentry=\index
\def\index{\indexentry{\jobname}}
\def\ikwd{\indexentry{\jobname.kwd}}
% Les en-tetes personnalises
\pagestyle{myheadings}
\def\partmark#1{\markboth{Part \thepart. \ #1}{}}
\def\chaptermark#1{\markright{Chapter \thechapter. \ #1}}
% nth
\def\th{^{\hbox{\scriptsize th}}}
% Pour annuler l'espacement vertical qui suit un "verbatim"
\def\cancelverbatim{\vspace{-\topsep}\vspace{-\parskip}}% exact.
% Pour annuler l'espacement vertical entre deux \item consecutifs dans \options
\def\cancelitemspace{\vspace{-8mm}}% determine empiriquement
% Pour faire la cesure apres _ dans les identificateurs
\def\={\discretionary{}{}{}}
\def\cuthere{\discretionary{}{}{}}
% Pour la coupure en petits documents
\let\mysection=\section
%%% Augmenter l'espace entre numero de section
% et nom de section dans la table des matieres.
\def\l@section{\@dottedtocline{1}{1.5em}{2.8em}} % D'origine: 2.3
% Pour alltt
\def\rminalltt#1{{\rm #1}}
% redefinition de l'environnement alltt pour que les {} \ et % soient
% dans la bonne fonte
\let\@oldalltt=\alltt
\let\@oldendalltt=\endalltt
\renewenvironment{alltt}{%
\begingroup%
\renewcommand{\{}{\char`\{}%
\renewcommand{\}}{\char`\}}%
\renewcommand{\\}{\char`\\}%
\renewcommand{\%}{\char`\%}%
\@oldalltt%
}{%
\@oldendalltt%
\endgroup%
}
% Index stuff -- cf multind.sty
\def\printindex#1#2{\@restonecoltrue\if@twocolumn\@restonecolfalse\fi
\columnseprule \z@ \columnsep 35pt
\newpage \phantomsection \twocolumn[{\Large\bf #2 \vskip4ex}]
\markright{\uppercase{#2}}
\addcontentsline{toc}{chapter}{#2}
\@input{#1.ind}}
%%% Linking to modules
\ifocamldoc
\newcommand{\moduleref}[3]{\hyperref[#2]{#3}[\ref{#2}]}
\newcommand{\stdmoduleref}[1]{\moduleref{}{#1}{\texttt{#1}}}
\newcommand{\stdpageref}[1]{\pageref{#1}}
\else
\newcommand{\moduleLabel}[2]{page-#1-module-#2}
\newcommand{\moduleref}[3]{%
\hyperref[\moduleLabel{#1}{#2}]{#3}[\ref{\moduleLabel{#1}{#2}}]%
}
\newcommand{\stdmoduleref}[1]{\moduleref{libref-module-Stdlib}{#1}{\texttt{#1}}}
\newcommand{\stdpageref}[1]{\pageref{\moduleLabel{libref-module-Stdlib}{#1}}}
\fi
\newenvironment{linklist}{\begingroup\ocamldocinputstart}{\endgroup}
\newcommand{\compilerdocitem}[2]{\input{library/#1.tex}}
\newcommand{\libdocitem}[2]{\input{library/#1.tex}}
\ifocamldoc
\newcommand{\stddocitem}[2]{\libdocitem{#1}{#2}}
\else
\newcommand{\stddocitem}[2]{\libdocitem{Stdlib.#1}{#2}}
\fi
\newenvironment{maintitle}{\begin{center}}{\end{center}}
% Caml-example related command
\newenvironment{camlexample}[1]{}{}
\newenvironment{caml}{}{}
\newcommand{\ocamlkeyword}{\bfseries}
\newcommand{\ocamlhighlight}{\bfseries\uline}
\newcommand{\ocamlerror}{\bfseries}
\newcommand{\ocamlwarning}{\bfseries}
\newcommand{\?}{\color{black}\normalsize\tt\#{}}
\definecolor{gray}{gray}{0.5}
\newcommand{\ocamlcomment}{\color{gray}\normalfont\small}
\newcommand{\ocamlstring}{\color{gray}\bfseries}
\makeatother
|