13

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?

Stefan
  • 395

1 Answers1

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

David Carlisle
  • 757,742
  • 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 06 '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 06 '12 at 13:07