blob: c2ff320a7e52be13ccc771bd4656ed6f36749025 (
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
|
%=============================================================================
% V E R S A T I M . T E X
%=============================================================================
%
%
\newskip\verbatimindent \verbatimindent=0cm
\newskip\ttglue{\tt \global\ttglue=.5em plus.25em minus.15em}
\def\@{\char'100 }
%
\outer\def\begindisplay{\obeylines\startdisplay}
{\obeylines\gdef\startdisplay#1
{\catcode`\^^M=5$$#1\halign\bgroup&\hskip\verbatimindent##\hfil\cr}}
\outer\def\enddisplay{\crcr\egroup$$}
%
\chardef\other=12
\def\ttverbatim{\begingroup \catcode`\\=\other \catcode`\{=\other
\catcode`\}=\other \catcode`\$=\other \catcode`\&=\other
\catcode`\#=\other \catcode`\%=\other \catcode`\~=\other
\catcode`\_=\other \catcode`\^=\other\catcode`\*=\other\catcode`\==\other
%
\ifapl
\catcode`\A=12
\catcode`\B=12
\catcode`\C=12
\catcode`\D=12
\catcode`\E=12
\catcode`\F=12
\catcode`\G=12
\catcode`\H=12
\catcode`\I=12
\catcode`\J=12
\catcode`\K=12
\catcode`\L=12
\catcode`\M=12
\catcode`\N=12
\catcode`\O=12
\catcode`\P=12
\catcode`\Q=12
\catcode`\R=12
\catcode`\S=12
\catcode`\T=12
\catcode`\U=12
\catcode`\V=12
\catcode`\W=12
\catcode`\X=12
\catcode`\Y=12
\catcode`\Z=12
\fi
%
\obeyspaces \obeylines \tt}
{\obeyspaces\gdef {\ }}
%
\def\begintt{$$\let\par=\endgraf \ttverbatim \parskip=0pt
\catcode`\@=0 \parindent=\verbatimindent \rightskip=-5pc \ttfinish}
{\catcode`\@=0 @catcode`@\=\other % @ is temporary escape character
@obeylines % end of line is active
@gdef@ttfinish#1^^M#2\endtt{#1@vbox{#2}@endgroup$$}}
%
\catcode`\@=\active
{\obeylines\gdef@{\ttverbatim\spaceskip=\ttglue\let^^M=\ \let@=\endgroup}}
\def\beginlines{\par\begingroup\nobreak\medskip\parindent=0pt
\kern1pt\nobreak \obeylines \everypar{\strut}}
\def\endlines{\kern1pt\endgroup\medbreak\noindent}
|