X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=ucw-verb.tex;h=981aebefbb834fa4062d6e10a142aae038c30c3a;hb=refs%2Ftags%2Fv1.0;hp=2b9890972e8a7c6cc4112493741862e246aa12bf;hpb=3b3af3ae6bed74cdcf1681ad41a45e0c32391fb4;p=ucwmac.git diff --git a/ucw-verb.tex b/ucw-verb.tex index 2b98909..981aebe 100644 --- a/ucw-verb.tex +++ b/ucw-verb.tex @@ -1,4 +1,4 @@ -% The UCW Macro Collection: Verbatim environment +% The UCW Macro Collection: Verbatim environments % Written by Martin Mares in 2010 and placed into public domain % ------------------------------------------------------------------------- @@ -9,7 +9,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 @@ -28,9 +28,21 @@ \gdef\showsp@ces{\ifshowspaces\let =\sp@ce\fi} \global\let =\ } -\catcode124=\active % Make | active -\def\ttst@rt{\begingroup\setverb@tim\let|=\endgroup} -\let|=\ttst@rt +{\catcode124=\active % Make | active +\gdef\ttst@rt{\begingroup\setverb@tim\let|=\endgroup} +\gdef\inlineverbon{\catcode124=\active\let|=\ttst@rt} +\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\sv@rb} % Typesetting of verbatim blocks: % - the block is enclosed in balanced {}'s