Received: by nummer-3.proteosys id <01C19442.D46FF6CC@nummer-3.proteosys>; Thu, 3 Jan 2002 11:38:49 +0100 MIME-Version: 1.0 x-vm-v5-data: ([nil nil nil nil nil nil nil t nil][nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil]) Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C19442.D46FF6CC" X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message Subject: RE: VERB IN HEADINGS (full) Date: Wed, 10 Oct 1990 13:12:55 +0100 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: From: "MITTELBACH FRANK" Sender: "LaTeX-L Mailing list" To: "Rainer Schoepf" Reply-To: "LaTeX-L Mailing list" Status: R X-Status: X-Keywords: X-UID: 239 This is a multi-part message in MIME format. ------_=_NextPart_001_01C19442.D46FF6CC Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sorry that the unfinished mail went through the list. here is the completed answer. > > His suggestion of using \meaning doesn't seem right to me: > it would work only if the verbatim object is a control sequence. > Or have I misunderstood something? I don't know. One can say: \def\strip#1->{} \def\verb#1{\def\@tempa{#1}\expandafter\strip\meaning\@tempa} (something of this sort). Of course the reading mechanism for \verb has to be different, and I don't know whether I remembered the outcome of \meaning correctly. This has the advantage that it will always work correctly in the sence that it does not produce errors. I will however produce some kind of generalized spacing, i.e. \verb{\ab \ab} will come out `\ab \ab' if I remember correctly. One has to scan perhaps for spaces and turn them into something like \ before sending the result back but this is a minor matter. > > It should be possible to absorb the macro argument > one token, or rather: one undelimited macro argument, > at a time. Whenever the token is \verb (test by \ifx, > this will work even if the user has \let something to > \verb), verbatim mode is switched on, and character tokens are > produced for every character in the verbatim string. > > Other fun part: macros can scoop up whole groups, and > you have to recognize that you have got hold of a group > instead of a token, if that is the case you have to > reinsert the braces (I programmed something like this > a while ago. How do you generate a single brace: > \iftrue{\else}\fi. Ho hum.) because presumably there is > a macro in front of the group. This will only lose braces > around single tokens, but I don't think that matters. The idea of \iftrue{\else}\fi will work only when you are reconstruction the originial tokenlist very carefully using \edef together with noexpand etc. Otherwise one will end up with things like \mbox\iftrue{... which will bomb. A better possibility is perhaps the use of \aftergroup to construct the internal stuff. > > All of this is not particularly fast, and the one case where > it goes wrong is if the user has the verbatim text > inside a group. But h ere is the problem, it is actually not fast it is also a pain to write it for the general case but this could be solved. The real problem however is that it will not work for cases like \section{ A {\em very \verb=3D\special=3D macro} system} This would mean that there is again a nice class of headings which would produce big problems for the inexperienced user. What I like to see is a verb command that will always work. I think it is much better to tell the user that he has to use two (or more) \verb commands (in arguments) if he wants to generate spaces instead of leaving him with a mess of errors. Frank ------_=_NextPart_001_01C19442.D46FF6CC Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable RE: VERB IN HEADINGS (full)

Sorry that the unfinished mail went through the = list.
here is the completed answer.

>
> His suggestion of using \meaning doesn't seem = right to me:
> it would work only if the verbatim object is a = control sequence.
> Or have I misunderstood something?

I don't know. One can say:

\def\strip#1->{}
\def\verb#1{\def\@tempa{#1}\expandafter\strip\meaning\@tempa}

(something of this sort). Of course the reading
mechanism for \verb has to be different, and I = don't
know whether I remembered the outcome of = \meaning
correctly.  This has the advantage that it will = always
work correctly in the sence that it does not = produce
errors. I will however produce some kind of = generalized
spacing, i.e. \verb{\ab   \ab} will come = out `\ab \ab'
if I remember correctly.
One has to scan perhaps for spaces and turn them = into
something like \ before sending the result back = but
this is a minor matter.

>
> It should be possible to absorb the macro = argument
> one token, or rather: one undelimited macro = argument,
> at a time. Whenever the token is \verb (test by = \ifx,
> this will work even if the user has \let = something to
> \verb), verbatim mode is switched on, and = character tokens are
> produced for every character in the verbatim = string.
>
> Other fun part: macros can scoop up whole = groups, and
> you have to recognize that you have got hold of = a group
> instead of a token, if that is the case you have = to
> reinsert the braces (I programmed something like = this
> a while ago. How do you generate a single = brace:
> \iftrue{\else}\fi. Ho hum.) because presumably = there is
> a macro in front of the group. This will only = lose braces
> around single tokens, but I don't think that = matters.

The idea of \iftrue{\else}\fi will work only when = you
are reconstruction the originial tokenlist = very
carefully using \edef together with noexpand = etc.
Otherwise one will end up with things like
\mbox\iftrue{... which will bomb. A better = possibility
is perhaps the use of \aftergroup to construct = the
internal stuff.

>
> All of this is not particularly fast, and the = one case where
> it goes wrong is if the user has the verbatim = text
> inside a group.

But h ere is the problem, it is actually not fast it = is
also a pain to write it for the general case but = this
could be solved.  The real problem however is = that it
will not work for cases like \section{ A {\em = very
\verb=3D\special=3D macro} system}

This would mean that there is again a nice class = of
headings which would produce big problems for = the
inexperienced user.  What I like to see is a = verb
command that will always work.  I think it is = much
better to tell the user that he has to use two = (or
more) \verb commands (in arguments) if he wants = to
generate spaces instead of leaving him with a mess = of
errors.

Frank

------_=_NextPart_001_01C19442.D46FF6CC--