# 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?

-

\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.