Featured Book

LaTeX Beginners Guide

Who is online

In total there are 16 users online :: 1 registered, 0 hidden and 15 guests (based on users active over the past 5 minutes)
Most users ever online was 1327 on Tue Nov 05, 2013 7:11 pm

Users browsing this forum: Google [Bot] and 15 guests

Partner Sites

TeXwelt - Fragen und Antworten goLaTeX
TeXblog
TeXnicCenter
TeXample

\string command behavior - Plain TeX Topic is solved

fontsplainAdd tags LaTeX specific issues not fitting into one of the other forums of this category.

\string command behavior - Plain TeX

Postby renyalvarado on Sun Feb 3rd, 2013

Hi, I would like to learn Plain TeX and I'm reading Knuth's "The TeXBook".At Chapter 7, Knuth talks about the \string command and how it converts control sequences into lists of characters tokens. Why when I typed \string\TeX I got "TeX, but when I wrote {\tt \string\TeX} I got \TeX?

I guess it's something related to \escapechar, because when I changed this control sequence the output changed too:
Code: Select all  •  Open in writeLaTeX
\escapechar=`^
\string\TeX

generates
^TeX
User avatar
renyalvarado
 
Posts: 3
Joined: Mon Jun 4th, 2012

Re: \string command behavior - Plain TeX  Topic is solved

Postby Stefan_K on Sun Feb 3rd, 2013

Run this code (or click Open in writeLaTeX), and you can see that the backslash \ from the typewriter font is replaced by " in the font table of the roman font - at place '134 (92):

Code: Select all  •  Open in writeLaTeX
\documentclass{article}
\usepackage{fonttable}
\begin{document}
\fonttable{cmr8}
\fonttable{cmtt8}
\end{document
}


cmr.png
cmr.png (21.84 KiB) Viewed 1072 times

cmtt.png
cmtt.png (16.63 KiB) Viewed 1072 times


You may notice further differences regarding special symbols. In typewriter font, most used special symbols are different to those required in standard text.

Stefan
LaTeX Community Administrator
User avatar
Stefan_K
Site Admin
 
Posts: 6449
Joined: Mon Mar 10th, 2008
Location: Hamburg, Germany

Re: \string command behavior - Plain TeX

Postby cgnieder on Sun Feb 3rd, 2013

See also the same question on TeX.sx with currently two answers.

Regards
Clemens
------------------------------
New German Q&A site about TeX: http://texwelt.de/wissen
System: TeXlive 2013, OpenSUSE 12.3
User avatar
cgnieder
Site Moderator
 
Posts: 1696
Joined: Sat Apr 16th, 2011
Location: Germany


Topic Tags

fontsplain

Return to General

Who is online

Users browsing this forum: Google [Bot] and 15 guests