I'm using the tufte-latex layout, and running into problems with the double-sided mode. I found a proposed bug-fix here and applied it to the most recent version of tufte-latex available on github
% Define Tuftian float styles (with the caption in the margin)
% original \floatc@tufteplain command
% \newcommand{\floatc@tufteplain}[2]{%
% \begin{lrbox}{\@tufte@caption@box}%
% \begin{minipage}[\floatalignment]{\marginparwidth}\hbox{}%
% \@tufte@caption@font{\@fs@cfont #1:} #2\par%
% \end{minipage}%
% \end{lrbox}%
% \smash{\hspace{\@tufte@caption@fill}\usebox{\@tufte@caption@box}}%
% }
% bugfix? - http://code.google.com/p/tufte-latex/issues/detail?id=50
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\floatc@tufteplain}[2]{%
\begin{lrbox}{\@tufte@caption@box}%
\begin{minipage}[\floatalignment]{\marginparwidth}\hbox{}%
\@tufte@caption@font{\@fs@cfont #1:} #2\par%
\end{minipage}%
\end{lrbox}%
\@tufte@checkoddpage%
\ifthenelse{\boolean{@tufte@odd@page}}%
{\gsetboolean{@tufte@float@recto}{true}\@tufte@float@debug{Detected page: [recto/odd]}}%
{\gsetboolean{@tufte@float@recto}{false}\@tufte@float@debug{Detected page: [verso/even]}}%
\ifthenelse{\NOT\boolean{@tufte@symmetric}\OR\boolean{@tufte@float@recto}}{%
% asymmetric or page is odd, so caption is on the right
\smash{\hspace{\@tufte@caption@fill}\usebox{\@tufte@caption@box}}%
\@tufte@float@debug{Caption position: [right]}%
}{% symmetric pages and page is even, so caption is on the left
\smash{\hspace{-\@tufte@overhang}\usebox{\@tufte@caption@box}}%
\@tufte@float@debug{Caption position: [left]}%
}%
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\fs@tufteplain}{%
\def\@fs@cfont{\@tufte@caption@font}%
\let\@fs@capt\floatc@tufteplain%
\def\@fs@pre{}%
\def\@fs@post{}%
\def\@fs@mid{}%
\let\@fs@iftopcapt\iftrue%
}
\let\fs@tufteplaintop=\fs@tufteplain
\let\floatc@tufteplaintop=\floatc@tufteplain
\newcommand\floatc@tufteruled[2]{%
{\@fs@cfont #1} #2\par%
}
\newcommand\fs@tufteruled{%
\def\@fs@cfont{\@tufte@caption@font}%
\let\@fs@capt\floatc@tufteplain%
\def\@fs@pre{\hrule height.8pt depth0pt width\textwidth \kern2pt}%
\def\@fs@post{\kern2pt\hrule width\textwidth\relax}%
\def\@fs@mid{}%
\let\@fs@iftopcapt\iftrue%
}
\newcommand\fs@tufteboxed{%
\def\@fs@cfont{}%
\let\@fs@capt\floatc@tufteplain%
\def\@fs@pre{%
\setbox\@currbox\vbox{\hbadness10000
\moveleft3.4pt\vbox{\advance\hsize by6.8pt
\hrule \hbox to\hsize{\vrule\kern3pt
\vbox{\kern3pt\box\@currbox\kern3pt}\kern3pt\vrule}\hrule}}
}%
\def\@fs@mid{\kern2pt}%
\def\@fs@post{}%
\let\@fs@iftopcapt\iftrue%
}
}{%
% Nothing to do
}
}
I commented out what I thought was the relevant section, and pasted in the code that I found. However, I'm not sure if I have commented out all of the relevant parts as my problem still exists. For example, here you can see the caption on the wrong side of the margin:
I've noticed that the problem only occurs with tables or figures that are positioned at the top of the page. Captions elsewhere in the page are fine. I have also found that running \clearpage
does result in the offending caption and figure or table to move to the correct side of the page, but this is not my preferred way of solving the problem for something book length!