X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=ucw-verb.tex;h=a7b19730e145cf83893bec492fe74c0b1ec38f70;hb=refs%2Fheads%2Fmaster;hp=d6e5317b4ed3ce3fe420919f8e6e7373e4fd9e8f;hpb=0da2337ea4aed464ff7f7b2a9ec1b811cc057a4d;p=ucwmac.git diff --git a/ucw-verb.tex b/ucw-verb.tex index d6e5317..a7b1973 100644 --- a/ucw-verb.tex +++ b/ucw-verb.tex @@ -1,7 +1,9 @@ -% The UCW Macro Collection: Verbatim environment +% The UCW Macro Collection: Verbatim environments % Written by Martin Mares 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 @@ -34,6 +36,16 @@ \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 @@ -120,7 +132,7 @@ % 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