-% The UCW Macro Collection: Verbatim environment
+% The UCW Macro Collection: Verbatim environments
% Written by Martin Mares <mj@ucw.cz> in 2010 and placed into public domain
% -------------------------------------------------------------------------
+\ucwdefmodule{verb}
+
% We'll use internal macros of plain TeX
\catcode`@=11
\def\frenchsp@cing{\sfcode`\.\@m \sfcode`\?\@m \sfcode`\!\@m%
\sfcode`\:\@m \sfcode`\;\@m \sfcode`\,\@m}
-% Typesetting of one verbatim word: |word|
+% Typesetting of one verbatim word: |word| (enable by \inlineverbon)
% Set if spaces should be rendered as "bath-tub" glyphs
\newif\ifshowspaces
\gdef\inlineverboff{\catcode124=12}
}
+% Typesetting of verbatim text with a given delimiter:
+% - usage: \verb%verbatim text%
+% - the delimiter is the first character after \verb
+% - remember that writing (for example) \verbz with meaning \verb
+% with the delimiter 'z' is possible only if \catcode`z is not 11
+
+\def\verb{\relax\def\sv@rb##1{\uccode`~=`##1%
+\uppercase{\catcode`~13\global\let~\endgroup}}%
+\begingroup\setverb@tim\do\|\sv@rb}
+
% Typesetting of verbatim blocks:
% - the block is enclosed in balanced {}'s
% - leading and trailing empty lines are ignored
% Input file verbatim
-\def\verbinput#1{\begingroup\v@rbparams\verblocaldefs\setupt@bs\startb@x\input #1 \egroup\endgroup}
+\def\verbinput#1{\begingroup\v@rbparams\verblocaldefs\setupt@bs\startb@x\input #1 \v@rbend}
% Let's hide all internal macros
\catcode`@=12