\catcode`\@=11
\def\CtrlM@{\egroup
 \ifcase\litlines@\advance\litlines@\@ne\or
 \box\litbox@\advance\litlines@\@ne\else
 \penalty\interlitpenalty@\box\litbox@\fi
 \Lit@}
\def\Lit@{\setbox\litbox@\hbox\bgroup\litdefs@\hskip\litindent}
\def\littab#1{\littab@#1\relax}
\def\TAB@{\egroup
 \dimen@\wd\litbox@
 \advance\dimen@-\litindent
 \setboxz@h{\tt0}%
 \dimen@ii\littab@\wdz@
 \divide\dimen@\dimen@ii
 \multiply\dimen@\dimen@ii
 \advance\dimen@\littab@\wdz@
 \advance\dimen@\litindent
 \setbox\litbox@\hbox\bgroup\litdefs@\hbox to\dimen@{\unhbox\litbox@\hfil}}
\def\litbackslash#1{%
 \edef\litbs@{\catcode`\string#1=\z@
 \def\noexpand\litbs@@{\def\expandafter\noexpand\csname\string#1\endcsname
  {\char`\string#1}}}}
\def\litcodes@{\catcode`\\=12
 \catcode`\{=12 \catcode`\}=12
 \catcode`\$=12 \catcode`\&=12
 \catcode`\#=12
 \catcode`\^=12 \catcode`\_=12
 \catcode`\@=12 \catcode`\~=12 \catcode`\"=12
 \catcode`\;=12 \catcode`\:=12 \catcode`\!=12 \catcode`\?=12
 \catcode`\%=12 \litbs@\catcode`\`=\active\obeyspaces\defspace@}
\def\activate@#1#2{{\lccode`\~=`#2%
 \lowercase{%
  \if0#1%
  \gdef\Next@{\def~{\egroup\endgroup\bigskip\vskip-\parskip
   \def\next@{\noindent@@\FN@\pretendspace@}\FNSS@\next@}}\else
  \gdef\Next@{\def~{\egroup\egroup\endgroup}}\fi
  }%
 }}
\def\litdefs@{\let\0\empty\let\1\litdelim@\def\ {\char32 }\litbs@@}%
\def\litdelimiter#1{%
 \edef\litdelim@{\char`#1}%
 \def\lit#1{\leavevmode\begingroup\litcodes@\litdefs@
  \tt\hyphenchar\tentt\m@ne\lit@}%
 \def\lit@##1#1{##1\endgroup\null}%
 \def\Lit#1{\ifhmode$$\abovedisplayskip\bigskipamount
  \abovedisplayshortskip\bigskipamount
  \belowdisplayskip\z@\belowdisplayshortskip\z@
  \postdisplaypenalty\@M
  $$\vskip-\baselineskip\else\bigskip\fi
  \begingroup\litlines@\z@
  \catcode`#1=\active\activate@0#1\Next@
  \def\displaybreak{\egroup\break\litlines@\z@\Lit@}%
  \def\allowdisplaybreak{\egroup\allowbreak\litlines@\z@\Lit@}%
  \def\allowdisplaybreaks{\egroup\allowbreak\interlitpenalty@\z@
   \litlines@\z@\Lit@}%
  \litcodes@\tt\catcode`\^^I=\active\letTAB@
  \obeylines\letM@\Lit@}%
 \def\Litbox##1=#1{\begingroup\ifodd##1\relax\aftergroup\global\fi
  \aftergroup\setbox\aftergroup##1\aftergroup\box\aftergroup\Litbox@
  \def\allowdisplaybreak{\egroup\allowbreak\litlines@\z@\Lit@}%
  \def\allowdisplaybreaks{\egroup\allowbreak\interlitpenalty@\z@
   \litlines@\z@\Lit@}%
  \catcode`#1=\active\activate@1#1\Next@
  \litcodes@\tt\catcode`\^^I=\active\letTAB@
  \obeylines\letM@\global\setbox\Litbox@\vbox\bgroup\litindent\z@%
  \litlines@\z@\Lit@}%
}
\catcode`\@=\active
