Jump to content

TeX/csname

From Wikibooks, open books for an open world
< TeX

Synopsis

[edit | edit source]
\csname

Description

[edit | edit source]

Used with \endcsname. The text between the two commands build the name of a TeX command.

Example

[edit | edit source]
 \def\x{paragraph}

 % \def\startparagraph#1{...}
 \def\csname start\x\endcsname#1{...}

 % \def\stopparagraph#1{...}
 \def\csname stop\x\endcsname#1{...} 

 % \startparagraph{mytext}
 \csname start\x\endcsname{mytext}