blob: 8ec5d53d0a6b7efa63ee6d4669fdcd19260714cd (
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
|
% macros for verbatim scanning
% im wesentlichen dem file MANHDR TEX von DEK entnommen
\catcode`@=11
\def\tt{\fam\ttfam\tentt}%
\newskip\ttglue \ttglue=.5em plus .25em minus .15em
\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
\parskip \z@
\obeyspaces \obeylines \tt}
\def\begintt{$$\let\par=\endgraf \ttverbatim
\catcode`\|=0 \rightskip-5pc \ttfinish}
{\catcode`\|=0 |catcode`|\=\other % | is temporary escape character
|obeylines % end of line is active
|gdef|ttfinish#1^^M#2\endtt{|vbox{#2}|endgroup$$}}
\catcode`\|=\active
{\obeylines \gdef|{\ttverbatim \spaceskip\ttglue \let^^M=\ \let|=\endgroup}}
%\def\ttspace{{\tt\hskip\ttglue}}
\def\vrt{\hbox{\tt\char`\|}} % vertical line
\def\dn{\hbox{\tt\char'14}} % downward arrow
\def\up{\hbox{\tt\char'13}} % upward arrow
\def\]{\hbox{\tt\char`\ }} % visible space
\catcode`@=12 % at signs are no longer letters
\def\verbatimon{\catcode`\|=\active}
\def\verbatimoff{\catcode`\|=\other}
\verbatimoff
|