[texhax] [solved] Re: Issue about `~' character
rodolfo.medina at gmail.com
Fri Sep 30 22:12:00 CEST 2016
David Carlisle <d.p.carlisle at gmail.com> writes:
> On 30 September 2016 at 20:32, Rodolfo Medina <rodolfo.medina at gmail.com> wrote:
>> David Carlisle <d.p.carlisle at gmail.com> writes:
>>> On 30 September 2016 at 19:31, Rodolfo Medina <rodolfo.medina at gmail.com>
>>>> David Carlisle <d.p.carlisle at gmail.com> writes:
>>>> Fantastic, that works in my case. In this case you need three \string s.
>>>> I couldn't imagine. I had tried with two.
>>> don't think of it as three \string, its, just two tokens each preceded
>>> by \string so it gets written verbatim.
>>> You want your input file to have
>>> so to write that you can put \string before each token
>>> so it just more or less coincidentally ends up with three adjacent \string
>> I seem to understand... Then when I put two \string 's before `~' what
>> happened? How did TeX read and expand that?
> writes \string to the file and then ~ just writes what it would have
> written anyway as it isn't prefixed by anything so you get
> \string\penalty \@M \
> so when you read that back the \string applies to \penalty so it
> typesets \penalty then quibbles about \@M unless you are in math mode.
Clear now. This explains a lot about the use of \string. Thanks for this very
instructive lesson of `TeX'.
More information about the texhax