]> mj.ucw.cz Git - ucwmac.git/blobdiff - ucw-verb.tex
ucw-ref: Fixed bug in \pageid
[ucwmac.git] / ucw-verb.tex
index d6e5317b4ed3ce3fe420919f8e6e7373e4fd9e8f..a7b19730e145cf83893bec492fe74c0b1ec38f70 100644 (file)
@@ -1,7 +1,9 @@
-% 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
 
@@ -9,7 +11,7 @@
 \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