# Why isn't a zero-width box in math mode aligned on the baseline?

I'd like to move equation labels into the margin for an article I'm working on, and the answers in Theorem Name/Numbering in Margin accomplish exactly what I'm looking for. Here is a small example:

\documentclass{article}

\usepackage{amsmath,amssymb,amsthm}

\makeatletter
\let\mytagform@=\tagform@
\def\tagform@#1{%
\makebox[1sp][r]{\maketag@@@{(\ignorespaces#1 \unskip \@@italiccorr)}\hspace*{-1in}}%
}
\renewcommand{\eqref}[1]{\textup{\mytagform@{\ref{#1}}}}
\makeatother

\begin{document}

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

$$f(x) = x^2 \label{deepinsight}$$

See \ref{deepinsight} for an example.

\end{document}


When I first tried this, however, I used a box a box of zero width: \makebox[0pt][r]{ .... This almost works, but the resulting equation labels aren't vertically aligned with the equation anymore, as you see here:

After fiddling with this some more I realized that the original solution is using \llap which is probably a better way to get this effect, but I am still curious why a box with zero width is aligned differently than a box with some very small width. Thanks for any explanations or pointers!

-

## 1 Answer

A zero width equation number is used as a flag to get special handling. Just after describing the detailed rules for equation number placement the TeXBook says:

One consequence of these rules is that you can force an equation number to appear on a line by itself by making its width zero,

-