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
|
\documentclass[11pt]{book}
\usepackage{lmodern}% for T1 encoding and support of bold ttfamily
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{microtype}
% HEVEA\@def@charset{UTF-8}%
% Unicode character declarations
\DeclareUnicodeCharacter{207A}{{}^{+}}
\DeclareUnicodeCharacter{2014}{---}
\usepackage{fullpage}
\usepackage{syntaxdef}
\usepackage{multind}
\usepackage{html}
\usepackage{textcomp}
\usepackage{ocamldoc}
\usepackage{xspace}
\usepackage{color}
% Package for code examples:
\usepackage{listings}
\usepackage{alltt}
\usepackage[normalem]{ulem}% for underlining errors in code examples
\input{ifocamldoc}
\ifocamldoc\else
\usepackage{changepage}
\fi
\input{macros.tex}
% No ligatures in typewriter font
\DisableLigatures{encoding = T1, family = tt* }
% Listing environments
\lstnewenvironment{camloutput}{
\lstset{
inputencoding=utf8,
extendedchars=true,
basicstyle=\small\ttfamily\slshape,
showstringspaces=false,
language=caml,
escapeinside={$}{$},
columns=fullflexible,
stringstyle=\ocamlstring,
keepspaces=true,
keywordstyle=\ocamlkeyword,
keywords={[2]{val}}, keywordstyle={[2]\ocamlkeyword},
aboveskip=0\baselineskip,
}
\ifouthtml
\setenvclass{lstlisting}{pre caml-output ok}
\lstset {basicstyle=\ttfamily}
\else
\lstset{
upquote=true,
literate=%
{⁺}{{${}^{+}$}}1%
{—}{{---}}1%
{'"'}{\textquotesingle "\textquotesingle}3%
{'\\"'}{\textquotesingle \textbackslash"\textquotesingle}4,
}
\fi
}{}
\lstnewenvironment{camlinput}{
\lstset{
inputencoding=utf8,
extendedchars=true,
basicstyle=\ttfamily,
showstringspaces=false,
language=caml,
escapeinside={$}{$},
columns=fullflexible,
stringstyle=\ocamlstring,
commentstyle=\ocamlcomment,
keepspaces=true,
keywordstyle=\ocamlkeyword,
moredelim=[is][\ocamlhighlight]{<<}{>>},
moredelim=[s][\ocamlstring]{\{|}{|\}},
moredelim=[s][\ocamlstring]{\{delimiter|}{|delimiter\}},
keywords={[2]{val,initializer,nonrec}}, keywordstyle={[2]\ocamlkeyword},
belowskip=0\baselineskip
}
\ifouthtml
\setenvclass{lstlisting}{pre caml-input}
\else
%not implemented in hevea: upquote and literate
\lstset{
upquote=true,
literate=%
{⁺}{{${}^{+}$}}1%
{—}{{---}}1%
{'"'}{\textquotesingle "\textquotesingle}3%
{'\\"'}{\textquotesingle \textbackslash"\textquotesingle}4,
}
\fi
}{}
\lstnewenvironment{camlerror}{
\lstset{
escapeinside={$}{$},
showstringspaces=false,
basicstyle=\small\ttfamily\slshape,
emph={Error}, emphstyle={\ocamlerror},
}
\ifouthtml
\setenvclass{lstlisting}{pre caml-output error}
\lstset { basicstyle=\ttfamily }
\else
\lstset{upquote=true}
\fi
}
{}
\lstnewenvironment{camlwarn}{
\lstset{
escapeinside={$}{$},
showstringspaces=false,
basicstyle=\small\ttfamily\slshape,
emph={Warning}, emphstyle={\ocamlwarning},
}
\ifouthtml
\setenvclass{lstlisting}{pre caml-output warn}
\lstset { basicstyle=\ttfamily }
\else
\lstset{upquote=true}
\fi
}{}
\ifocamldoc\else
\lstnewenvironment{ocamlcodeblock}{
\lstset{
backgroundcolor = \color{lightgray},
basicstyle=\ttfamily,
showstringspaces=false,
language=caml,
escapeinside={$}{$},
columns=fullflexible,
stringstyle=\ocamlstring,
commentstyle=\ocamlcomment,
keepspaces=true,
keywordstyle=\ocamlkeyword,
moredelim=[is][\ocamlhighlight]{<<}{>>},
moredelim=[s][\ocamlstring]{\{|}{|\}},
moredelim=[s][\ocamlstring]{\{delimiter|}{|delimiter\}},
keywords={[2]{val,initializer,nonrec}}, keywordstyle={[2]\ocamlkeyword},
belowskip=0\baselineskip,
upquote=true,
literate={'"'}{\textquotesingle "\textquotesingle}3
{'\\"'}{\textquotesingle \textbackslash"\textquotesingle}4,
}
}{}
\newcommand{\ocamltag}[2]{\begin{ocaml#1}#2\end{ocaml#1}}
\newcommand{\ocamlcodefragment}[1]{{\ttfamily\setlength{\parindent}{0cm}%
\raggedright#1}}
\newcommand{\ocamlinlinecode}[1]{{\ttfamily#1}}
\newenvironment{ocamlarrow}{}{}
\newenvironment{ocamlexception}{\bfseries}{}
\newenvironment{ocamlextension}{\bfseries}{}
\newenvironment{ocamlconstructor}{\bfseries}{}
\newenvironment{ocamltype-var}{\itshape\ttfamily}{}
\definecolor{lightgray}{gray}{0.97}
\definecolor{gray}{gray}{0.5}
\newenvironment{ocamlindent}{\begin{adjustwidth}{2em}{0pt}}{\end{adjustwidth}}
\newenvironment{ocamltabular}[1]{\begin{tabular}{#1}}%
{\end{tabular}}
\newcommand{\bold}[1]{{\bfseries#1}}
\fi
% Add meta tag to the generated head tag
\ifouthtml
\let\oldmeta=\@meta
\renewcommand{\@meta}{
\oldmeta
\begin{rawhtml}
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
\end{rawhtml}
}
\fi
\usepackage[colorlinks,linkcolor=blue]{hyperref}
% Make _ a normal character in text mode
% it must be the last package included
\usepackage[strings,nohyphen]{underscore}
% Babel enables a finer control of the catcode of '_'
% and ensures that '_' is allowed in labels and references.
\usepackage[english]{babel}
%\makeatletter \def\@wrindex#1#2{\xdef \@indexfile{\csname #1@idxfile\endcsname}\@@wrindex#2||\\}\makeatother
\raggedbottom
\input{version.tex}
%HEVEA\tocnumber
%HEVEA\setcounter{cuttingdepth}{1}
%HEVEA\title{The OCaml system, release \ocamlversion}
\input{allfiles.tex}
|