diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /info/digests/texline/no7/verb.tex |
Initial commit
Diffstat (limited to 'info/digests/texline/no7/verb.tex')
-rw-r--r-- | info/digests/texline/no7/verb.tex | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/info/digests/texline/no7/verb.tex b/info/digests/texline/no7/verb.tex new file mode 100644 index 0000000000..f10ed90ee0 --- /dev/null +++ b/info/digests/texline/no7/verb.tex @@ -0,0 +1,32 @@ +% verbatim macros from the TeXbook +\newskip\ttglue +\ttglue=0.5em plus 0.25em minus 0.15em +\outer\def\begindisplay{\obeylines\startdisplay} +{\obeylines\gdef\startdisplay#1 + {\catcode`\^^M=5$$#1\halign\bgroup\indent##\hfil&&\qquad##\hfil\cr}} +\outer\def\enddisplay{\crcr\egroup$$} +% macros for verbatim scanning +\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 + \obeyspaces \obeylines \tt} + +\outer\def\begintt{$$\let\par=\endgraf \ttverbatim \parskip=0pt + \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{#1|vbox{#2}|endgroup$$}} + +\catcode`\|=\active +{\obeylines \gdef|{\ttverbatim \spaceskip\ttglue \let^^M=\ \let|=\endgroup}} + + |