0
$$\eqalign{&{}+7=b\cr}$$

and

$$\eqalign{&+7=b\cr}$$

are the same; but

$$\eqalign{{}+7=b\cr}$$

and

$$\eqalign{+7=b\cr}$$

differ from each other (the first has more space between + and 7). In all cases "+" is shown as \mathbin in \showlists. Why spacing is different with and without {} when & is used and when it is not?

NOTE: In the \displaylines example on p.196 of TeXbook it is mentioned that {} serves to make + a binary operation. This may be true for \displaylines, but it is not true for \eqalign, as demonstrated above.

1 Answer 1

4
\tracingonline1
\showboxdepth\maxdimen

1
$$\eqalign{{}+7=b\cr}\showlists$$


2
$$\eqalign{+7=b\cr}\showlists$$

\bye

a {} just makes an empty \mathord, and the\mathbin from + gets treated like a \mathord unless it is not at the start or end of a list.

In the first case you see

.....\hbox(0.0+0.0)x0.0
.....\glue(\medmuskip) 2.22217 plus 1.11108 minus 2.22217
.....\tenrm +
.....\glue(\medmuskip) 2.22217 plus 1.11108 minus 2.22217
.....\tenrm 7

that is an empty mathord atom, medmuskip either side of the + as it is a mathbin, then 7

In the second case you see

.....\tenrm +
.....\tenrm 7

no leading empty mathord (shown as \hbox) then + and 7 with no spacing as the \mathbin nature of + is suppressed.

Your first example, after the & the {} has no effect as the \eqalign macro adds a {} in the second column already:

\def\eqalign#1{\null\,\vcenter{\openup\jot\m@th
  \ialign{\strut\hfil$\displaystyle{##}$&$\displaystyle{{}##}$\hfil
      \crcr#1\crcr}}\,}

so the template for the second column is {}## and already starts with an empty mathord, so there you are comparing {}+7 and {}{}+7 which are the same output.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.