[Tex/LaTex] Put equation numbers in the sidemargin with Tufte-Latex class

equationsmarginsnumberingtufte

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?

Best 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
\begin{equation}\label{eq:myequation}
    f(x)=x^2
\end{equation}
Test reference: \eqref{eq:myequation}

\c

\end{document}

enter image description here

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 appearance of equation numbers with amsmath