summaryrefslogtreecommitdiff
path: root/support/mctex/verbatim.tex
diff options
context:
space:
mode:
Diffstat (limited to 'support/mctex/verbatim.tex')
-rw-r--r--support/mctex/verbatim.tex23
1 files changed, 23 insertions, 0 deletions
diff --git a/support/mctex/verbatim.tex b/support/mctex/verbatim.tex
new file mode 100644
index 0000000000..76169743f3
--- /dev/null
+++ b/support/mctex/verbatim.tex
@@ -0,0 +1,23 @@
+
+% macros for verbatim scanning
+\chardef\other=12
+\def\ttverbatim{\begingroup
+\parindent=0pt
+\def\par{\leavevmode\endgraf}%leave blank lines alone in verbatim
+ \catcode`\\=\other \catcode`\{=\other \catcode`\}=\other \catcode`\$=\other
+ \catcode`\&=\other \catcode`\#=\other \catcode`\%=\other \catcode`\~=\other
+ \catcode`\_=\other \catcode`\^=\other \catcode`\^^A=\other \catcode`\^^K=\other
+ \catcode`\^^M=\other\obeyspaces\obeylines\fixspace\tt}
+\outer\def\begintt{$$
+%\let\par=\endgraf
+\ttverbatim \parskip=\z@
+ \catcode`\|=0 \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\let|=\endgroup}}
+{\catcode`\ =\active
+\gdef\fixspace{\catcode`\ =\active\def {~}}}
+
+