LaTeX defines \vec as


which eventually is expanded to


whereas plainTeX defines it as

\def\vec{\mathaccent"017E }

replacing \relax with a space.

Is there any practical difference?

  • Most of the time a space will work, but \relax will always work. Feb 19, 2019 at 3:58

1 Answer 1


The syntax for \mathaccent is (TeXbook, p. 291)

\mathaccent⟨15-bit number⟩⟨math field⟩

A ⟨15-bit number⟩ is an integer (in any denotation allowed by LaTeX) in the range 0–215. What's a ⟨math field⟩? We find it on page 289

⟨math field⟩ → ⟨filler⟩⟨math symbol⟩ | ⟨filler⟩{⟨math mode material⟩}

A ⟨filler⟩ is any sequence of space tokens and \relax tokens which are ignored (doing expansion) when processing the input stream looking for something that fits the syntax rule.

Thus in LaTeX the \relax will be gobbled as a ⟨filler⟩, whereas in plain TeX the space terminates the specification for the number and is ignored as well.

Why does LaTeX use \relax? The answer is in the definition of \DeclareMathAccent that internally uses \set@mathaccent:

% latex.ltx, line 3596:

The choice might depend on the fact that when writing to an auxiliary file \relax is better suited to the job.

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.