summaryrefslogtreecommitdiff
path: root/macros/mtex/documentation/mdocverb.tex
diff options
context:
space:
mode:
Diffstat (limited to 'macros/mtex/documentation/mdocverb.tex')
-rw-r--r--macros/mtex/documentation/mdocverb.tex40
1 files changed, 40 insertions, 0 deletions
diff --git a/macros/mtex/documentation/mdocverb.tex b/macros/mtex/documentation/mdocverb.tex
new file mode 100644
index 0000000000..8ec5d53d0a
--- /dev/null
+++ b/macros/mtex/documentation/mdocverb.tex
@@ -0,0 +1,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