summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/plain/gustlib/verbatim-dek.tex
blob: ed2aa700b9c0913e6f3e19326a2cb1f1f2f78acb (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
%                 F I L E     V E R B A T I M . T E X
%
%          THIS SET OF MACROs IS TAKEN FROM D.E.K.'s TeXBook
%       AND PROVIDES AN EASY WAY OF TYPESETTING TEXTS VERBATIM:
%
% 1. \verbatim<character><text without that character><character>
%    causes the text to be set verbatim using \tt font; 
% 2. if the text uses up all the alphabet, \doubleverbatim macro 
%    can be used instead; this is similar to the previous one but 
%    a pair of characters is now used as a delimiter; 
% 3. in case of emergency \tripleverbatim macro may be of help... 
%
%---------------------------------------------
\def\uncatcodespecials % see D.E.K., pp. 344 and 380
    {\def\do##1{\catcode`##1=12}\dospecials}%
%---------------------------------------------
{\catcode`\^^I=\active \gdef^^I{\ \ \ \ }% TAB character is replaced by
                                         % 4 spaces; it is better than
                                         % nothing, but it does not mimic
                                         % true tabbing satisfactorily---maybe
                                         % some nice day...
 \catcode`\`=\active\gdef`{\relax\lq}}% this line inhibits Spanish 
                                      % ligatures ?` and !` of \tt font
\def\setupverbatim % see D.E.K., p. 381
    {\tt %
     \spaceskip=0pt \xspaceskip=0pt % just in case...
     \catcode`\^^I=\active %
     \catcode`\`=\active %
     \def\par{\leavevmode\endgraf}% this causes that empty lines aren't 
                                  % skipped
     \obeylines \uncatcodespecials \obeyspaces}%
{\obeyspaces \global\let =\ }% this causes that leading blanks aren't 
                             % skipped; cf. also def's of \space, \endgraf,
                             % \lq, \obeyspaces, and \obeylines, 
                             % D.E.K., pp. 351--352
%---------------------------------------------
% see D.E.K., p. 382
\def\doverbatim#1{\def\next##1#1{##1\endgroup}\next}%
\def\verbatim{\begingroup\setupverbatim\doverbatim}%
%----------
\def\dodoubleverbatim#1#2{\def\next##1#1#2{##1\endgroup}\next}%
\def\doubleverbatim{\begingroup\setupverbatim\dodoubleverbatim}%
%----------
\def\dotripleverbatim#1#2#3{\def\next##1#1#2#3{##1\endgroup}\next}%
\def\tripleverbatim{\begingroup\setupverbatim\dotripleverbatim}%
%---------------------------------------------
\endinput