# Put equation numbers in the sidemargin with Tufte-Latex class

In Tufte-Latex all captions etc. are in the side margin. I want to put the equation numbers there as well. Is it possible to do this?

-

## 1 Answer

\documentclass{tufte-book}

\def\a{One two three. }
\def\b{\a Five. \a Six seven eight. \a \a}
\def\c{\b\b\b\b}

\usepackage{amsmath}

\makeatletter

\let\orig@maketag@@@\maketag@@@
\renewcommand{\eqref}[1]{\textup{\let\maketag@@@\orig@maketag@@@\tagform@{\ref{#1}}}}

\def\maketag@@@#1{\hbox{\rlap{\kern\marginparsep\m@th\normalfont#1}\kern1sp}}
\makeatother

\begin{document}

\b\b\b\marginpar{aaa}\b\b

\begin{figure}[h]
zzz
\caption{zz zz zz}
\end{figure}

bbb
$$\label{eq:myequation} f(x)=x^2$$
Test reference: \eqref{eq:myequation}

\c

\end{document}


The only tricky bit is the \kern1sp as a zero width tag seems to throw amsmath of course and it moves the number down as if there were not room for it on the line.

See also

Changing the apperance of equation numbers with amsmath

-
That's exactly what I want! The only thing you need to take care of by hand: marginnotes that are "too" long and cover the equation number. –  Stefan Aug 6 '12 at 11:52
Well that's harder to fix. You could make the equation numbers marginotes but then they would drift away from the equations. I do have an old half finished answer to a question on this site that implements a margin note mechanism that would allow equations to "block" parts of the margin area, but it involves re-writing large swathes of latex internals and doesn't work, so I don't recommend it:-) –  David Carlisle Aug 6 '12 at 13:07