Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

plain tex: problem printing backslash

422 views
Skip to first unread message

eds

unread,
Apr 28, 2012, 2:45:59 PM4/28/12
to
I've found a problem when attempting to print/typeset a backslash.
When I do something like:
\string\TeX the backslash is printed as a double left quote, but when
I typeset a backslash with $\backslash$, it prints correctly.

Can someone suggest how I get \string\TeX to print the backslash
rather than the double left quotes?

regards,
eds

Enrico Gregorio

unread,
Apr 28, 2012, 4:29:13 PM4/28/12
to
In the default font used by Plain TeX (cmr10), the ASCII slot of
the backslash is occupied by the double left quote; Knuth wanted
(had) to put in the fonts only 128 glyphs, so the ones which are
not used in common typographic tasks were omitted and substituted
with more common glyphs.

Just say

{\tt\string\TeX}

so that you also get typewriter type, that's normally used for
printing command names.

Ciao
Enrico

Robin Fairbairns

unread,
Apr 28, 2012, 6:36:30 PM4/28/12
to
there is no backslash in cmr10's character set.

if _i_ want to typeset a macro, i use cmtt10, whose character set is
different.

{\tt\string\TeX} does it.
--
Robin Fairbairns, Cambridge
sorry about all this posting. i'll go back to sleep in a bit.

Christine Roemer

unread,
Apr 29, 2012, 3:09:48 AM4/29/12
to
> eds<edstu...@gmail.com> writes:
>
>> I've found a problem when attempting to print/typeset a backslash.
>> When I do something like:
>> \string\TeX the backslash is printed as a double left quote, but when
>> I typeset a backslash with $\backslash$, it prints correctly.

TeX: \def\backslash{\delimiter "26E30F }

Heiko Oberdiek

unread,
Apr 29, 2012, 3:49:27 AM4/29/12
to
That's the definition of plain TeX defines. It's the alternative,
if \tt should not be used and it's need math mode:
$\backslash$TeX

--
Heiko Oberdiek

eds

unread,
May 2, 2012, 9:47:31 AM5/2/12
to
Thanks everyone for the correct and prompt responses. I'm a little
smarter about TeX fonts now as a result.

The answer, as pointed out in the responses, is that the default font
defines character 92 (the default escape character) as a double left
quote. The easy solution is to select a font where character 92 is
the backslash, for example the cmtt10 font which can be used via the
\tt control sequence. Therefore {\tt\string\TeX} does the trick.

The $\backslash$ prints a backslash because math mode has different
fonts which include the backslash.

regards,
eds
0 new messages