summaryrefslogtreecommitdiff
path: root/manual/styles/caml-sl.sty
blob: c4061e4a4d5153a63f4c0822da5d5e04429c0d26 (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
% CAML style option, for use with the caml-latex filter.

\typeout{Document Style option `caml-sl' <7 Apr 92>.}

{\catcode`\^^M=\active %
 \gdef\@camlinputline#1^^M{\normalsize\tt\# #1\par} %
 \gdef\@camloutputline#1^^M{\small\ttfamily\slshape#1\par} } %
\def\@camlblankline{\medskip}
\chardef\@camlbackslash="5C
\def\@bunderline{\setbox0\hbox\bgroup\let\par\@parinunderline}

\def \@parinunderline {\futurelet \@next \@@parinunderline}
\def \@@parinunderline {\ifx \@next \? \let \@do \@@par@inunderline \else \let \@do \@@@parinunderline \fi \@do}
\def \@@par@inunderline #1{\@eunderline\@oldpar\?\@bunderline}
\def \@@@parinunderline {\@eunderline\@oldpar\@bunderline}
\def\@eunderline{\egroup\underline{\box0}}
\def\@camlnoop{}

\def\caml{
    \bgroup
    \flushleft
    \parindent 0pt
    \parskip 0pt
    \let\do\@makeother\dospecials
    \catcode13=\active    % 13 = ^M = CR
    \catcode92=0          % 92 = \
    \catcode32=\active    % 32 = SPC
    \frenchspacing
    \@vobeyspaces
    \let\@oldpar\par
    \let\?\@camlinputline
    \let\:\@camloutputline
    \let\;\@camlblankline
    \let\<\@bunderline
    \let\>\@eunderline
    \let\\\@camlbackslash
    \let\-\@camlnoop
}

\def\endcaml{
  \endflushleft
  \egroup\noindent
}