[tex-eplain] Verbatim text as macro parameter

Oleg Katsitadze olegkat at gmail.com
Mon Oct 5 07:01:52 CEST 2009

Hi Helmut,

On Tue, Sep 29, 2009 at 10:06:09PM +0200, Helmut Jarausch wrote:
> E.g. I want verbatim text in enumerated list or a footnote.

Footnotes shouldn't require anything special, see example below.

> Is it possible to get verbatim text into an hbox or a token register?

Here's an example, based on Eplain's \idx at getverbatimarg:

\input eplain


    \catcode`\ =10   % Swallow multiple consequent spaces.
    \catcode`\^^I=10 % Just in case, to avoid dependence on
    \catcode`\^^M=5  % current meanings of tabs and newlines.

{\tt \the\verbtoks}

{\tt \the\verbtoks}

% Note that footnotes should work without any tricks.
Blah\footnote*{This is verbatim: \verbatim $#%^|endverbatim}


If you need to rescan the verbatim argument with "normal" catcodes,
Eplain provides \scantokens.  It is actually a primitive in e-TeX, but
Eplain emulates it on other engines so it's always available.  See
Eplain's \idx at scanterm for some caveats.


More information about the tex-eplain mailing list