11

Why do both The TeXbook and latex.ltx define \z@skip=0pt plus0pt minus0pt? Wouldn't \z@skip=0pt or perhaps \z@skip=0pt\relax be shorter and yield the same? I always thought that the stretch and shrink are zero by default.

  • 7
    Why down vote?? – Sigur Aug 29 '22 at 19:08
  • 3
    The usual problem with "why" questions is because only the original author can really answer them. But I agree that "wouldn't this alternative yield the same" is a good question (+1). (I'm pretty sure that without the \relax, you can run into really strange errors arising from "some expression plus something else" becoming "0pt plus something else". But that still leaves the question of "why not just relax?") – Teepeemm Aug 29 '22 at 19:19
  • @Teepeemm The suggested alternatives are shorter. Also, searching for “why” returns 32,416 results as of now. I could imagine that parsing and evaluating yet another macro \relax might hypothetically take more time than parsing and evaluating plus0pt minus0pt. Or, perhaps, the default interpretation of absent stretch and shrink could hypothetically be changed to nonzeros. I don't really know; hence the question. –  Aug 29 '22 at 19:59

1 Answers1

11

In plain.tex we see

\newskip\z@skip \z@skip=0pt plus0pt minus0pt
\newbox\voidb@x % permanently void box register

If it had been

\newskip\z@skip \z@skip=0pt
\newbox\voidb@x % permanently void box register

then TeX would proceed to expand \newbox and lose time just to put back tokens. And it would need the knowledge of what the expansion of \newbox is anyway.

The alternative

\newskip\z@skip \z@skip=0pt\relax
\newbox\voidb@x % permanently void box register

would avoid the expansion and produce the same result, at the expense of clarity.

In latex.ltx the part is a straight copy from plain.tex.

egreg
  • 1,121,712