%\filename{QuoteTeX.tex}
%\edited{last by stolfi on Fri Oct 10 00:29:18 1986}

% Macros to typeset TeX source text
% Originally from Mike Plass

% If you say |bla bla bla|, the text within the vertical bars is 
% put into a \vbox, using font \tt. All characters are \catcode'd 
% to "other" (12), except "?" which is the escape character.
% (You can use ?? to get a single ?, and ?| to get a vertical bar).

\catcode`\|=\active

\begingroup
  \catcode`\@=11
  \endlinechar=-1

  \gdef\verbatim{ 
      \catcode`\\=12\catcode`\{=12
      \catcode`\}=12\catcode`\$=12\catcode`\&=12\catcode`\%=12
      \catcode`\#=12\catcode`\~=12\catcode`\^=12\catcode`\_=12
      \obeyspaces
    }
    
  {\catcode`\ =\active\gdef\obeyspaces{\catcode`\ =\active\let =\ }}
  {\catcode`\^^M=\active\gdef\alignlines{\catcode`\^^M=\active\let^^M=\crcr}}

  % These are in case active blanks or ^^Ms occur in a \write:
  {\catcode`\ =\active\global\let =\ }
  {\catcode`\^^M=\active\global\let^^M=\par}

  \gdef|{\begingroup\verbatim\alignlines\qu@tebox}

  \outer\gdef\qu@tebox#1|{\vbox{
      \tt\spaceskip=0.5em\halign{\strut##\hfil\cr#1\crcr}
    }
    \endgroup
  }

  \gdef\beginlines{\par\begingroup
      \parindent=0pt\everypar{\strut}
      \nobreak \medskip \hrule \kern1pt \nobreak
      \obeylines
    }

  \gdef\endlines{\kern1pt\hrule\endgroup\medbreak\noindent}
  
\endgroup


