Suppose I use ' as active character to insert another symbol:

{\tt A'C B}

\def\adef#1{\catcode`#1=13 \begingroup \lccode`\~=`#1\lowercase{\endgroup\def~}}

{\tt A'C B}

{\tt A'c B}

Log file contains this:

Missing character: There is no ^^dc in font cmtt10!

Why in the second case the result is not A'C B, although the third case works as expected?


This is due to not having a space in the definition of the active ':


should be

\adef'{\char"0D }

so TeX will know where the constant terminates (and the space will be gobbled by TeX rule).

In the first case, TeX is presented with


that becomes


and TeX duly looks for character number "DC (which of course doesn't exist in a seven bit font).

In the second case the input stream is


and, since c is not legal in an hexadecimal number, according to the syntax rules, the found number is "0D that's what is wanted.

Always leave a space after a required constant.

| improve this answer | |
  • May \relax be used in such cases instead of space? – Igor Liferenko May 25 '15 at 1:57
  • @IgorLiferenko Using \relax may be bad in cases where full expandability is needed. In the case of \char, there's no problem. – egreg May 25 '15 at 6:25

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.