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.
\begin{equation}
f(x) = x^2 \label{deepinsight}
\end{equation}
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!