I am using several special character commands, such as those described at Which symbols need to be escaped in ConTeXt?. I noticed that some, such as \textdollar will not work if they are immediately followed by some other word, e.g.:

\textbraceleftThis is some text.\textbraceright

To fix this, I have added some spaces after the command:

\textbraceleft This is some text.\textbraceright
  • Is it correct to always place spaces after these commands? Are there any cases where this will create problems, such as a line break when the two items should be placed together?
  • Are the \# and \& treated differently?

This has nothing to do with the meaning of \textbraceleft, in the sense that this is a rule valid for all macros (or more generally, control sequences).

TeX scanning of a control word ends with the first nonletter. The first example you give is the control word \textbraceleftThis which is probably undefined.

On the other hand, \# is not a control word, because the backslash is followed by a nonletter. By rule it is a control symbol and the scanning ends there: only one nonletter can be part of the command's name. Therefore


will give



\# text

will give

# test

with a space.

A space after a control word is ignored. Not after a control symbol. This is one of the first rules one learns with TeX.

Weren't for this rule, one couldn't have macros

\a \ab \abc \abcd \abcde

which are instead possible and all with unrelated meanings.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.