2

In the LaTeX kernel, we can see these definitions:

\def\@plus{plus}
\def\@minus{minus}
\def\@height{height}
\def\@depth{depth}
\def\@width{width}

It is said that these definitions can be used to save token space. How to understand this point of view?

Stephen
  • 3,826

1 Answers1

2

An example:

\def\stretch#1{\z@ \@plus #1fill\relax}

against

\def\stretch#1{\z@ plus #1fill\relax}

The former needs to store nine tokens, the latter thirteen. Every time \@plus is used in a definition, there's a gain of four tokens. The kernel uses \@plus fifteen times, so the net gain is 60 tokens.

There are also 26 and 27 appearances of \@height and \@width respectively.

It may seem rather small, but it allowed LaTeX to run in the nineties. Not to mention \z@ that can stand for 0 as a constant or 0pt as a dimension. In the former case the gain is one token per appearance (one for the characters and one for the trailing space).

egreg
  • 1,121,712
  • Gain of \@plus should be three tokens not four, plus doesn't require a space, so it's \z@ plus#1fill vs \z@\@plus #1fill. – Skillmon Jan 12 '23 at 13:16