|
|
@@ -1030,16 +1030,21 @@ |
|
|
\let\@tufte@orig@label\label% |
|
|
\let\@tufte@orig@label\label% |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
% New length for tweaking float captions |
|
|
|
|
|
\newlength{\@tufte@caption@vertical@offset} |
|
|
|
|
|
\setlength{\@tufte@caption@vertical@offset}{0pt} |
|
|
|
|
|
|
|
|
% Store the caption and label contents |
|
|
% Store the caption and label contents |
|
|
\newcommand{\@tufte@stored@shortcaption}{} |
|
|
\newcommand{\@tufte@stored@shortcaption}{} |
|
|
\newcommand{\@tufte@stored@caption}{} |
|
|
\newcommand{\@tufte@stored@caption}{} |
|
|
\newcommand{\@tufte@stored@label}{} |
|
|
\newcommand{\@tufte@stored@label}{} |
|
|
|
|
|
|
|
|
\newcommand{\@tufte@caption}[2][]{% |
|
|
|
|
|
|
|
|
\long\def\@tufte@caption[#1][#2]#3{% |
|
|
\ifthenelse{\isempty{#1}}% |
|
|
\ifthenelse{\isempty{#1}}% |
|
|
{\gdef\@tufte@stored@shortcaption{#2}}% |
|
|
|
|
|
|
|
|
{\gdef\@tufte@stored@shortcaption{#3}}% |
|
|
{\gdef\@tufte@stored@shortcaption{#1}}% |
|
|
{\gdef\@tufte@stored@shortcaption{#1}}% |
|
|
\gdef\@tufte@stored@caption{#2}% |
|
|
|
|
|
|
|
|
\gdef\@tufte@caption@vertical@offset{-#2}% we want positive push to lower captions |
|
|
|
|
|
\gdef\@tufte@stored@caption{#3}% |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
\newcommand{\@tufte@label}[1]{% |
|
|
\newcommand{\@tufte@label}[1]{% |
|
|
@@ -1071,8 +1076,8 @@ |
|
|
\ifthenelse{\equal{#1}{b}\OR\equal{#1}{B}}% |
|
|
\ifthenelse{\equal{#1}{b}\OR\equal{#1}{B}}% |
|
|
{\renewcommand{\floatalignment}{b}}% |
|
|
{\renewcommand{\floatalignment}{b}}% |
|
|
{\renewcommand{\floatalignment}{t}}% |
|
|
{\renewcommand{\floatalignment}{t}}% |
|
|
% Caption the contents of the \caption and \label commands to use later |
|
|
|
|
|
\renewcommand{\caption}[2][]{\@tufte@caption[##1]{##2}}% |
|
|
|
|
|
|
|
|
% Capture the contents of the \caption and \label commands to use later |
|
|
|
|
|
\renewcommand{\caption}{\optparams{\@tufte@caption}{[][0pt]}}% |
|
|
\renewcommand{\label}[1]{\@tufte@label{##1}}% |
|
|
\renewcommand{\label}[1]{\@tufte@label{##1}}% |
|
|
\@tufte@orig@float{#2}[#1]% |
|
|
\@tufte@orig@float{#2}[#1]% |
|
|
\ifthenelse{\boolean{@tufte@float@star}}% |
|
|
\ifthenelse{\boolean{@tufte@float@star}}% |
|
|
@@ -1096,8 +1101,8 @@ |
|
|
\begin{fullwidth}% |
|
|
\begin{fullwidth}% |
|
|
\begin{minipage}[\floatalignment]{\linewidth}% |
|
|
\begin{minipage}[\floatalignment]{\linewidth}% |
|
|
\ifthenelse{\boolean{@tufte@float@star}}% |
|
|
\ifthenelse{\boolean{@tufte@float@star}}% |
|
|
{\@tufte@float@fullwidth{\@tufte@figure@box}{\@tufte@caption@box}}% |
|
|
|
|
|
{\@tufte@float@textwidth{\@tufte@figure@box}{\@tufte@caption@box}}% |
|
|
|
|
|
|
|
|
{\@tufte@float@fullwidth[\@tufte@caption@vertical@offset]{\@tufte@figure@box}{\@tufte@caption@box}}% |
|
|
|
|
|
{\@tufte@float@textwidth[\@tufte@caption@vertical@offset]{\@tufte@figure@box}{\@tufte@caption@box}}% |
|
|
\end{minipage}% |
|
|
\end{minipage}% |
|
|
\end{fullwidth}% |
|
|
\end{fullwidth}% |
|
|
\@tufte@orig@endfloat% |
|
|
\@tufte@orig@endfloat% |
|
|
@@ -1108,37 +1113,36 @@ |
|
|
\begin{lrbox}{\@tufte@caption@box}\hbox{}\end{lrbox}% |
|
|
\begin{lrbox}{\@tufte@caption@box}\hbox{}\end{lrbox}% |
|
|
\gdef\@tufte@stored@shortcaption{}% |
|
|
\gdef\@tufte@stored@shortcaption{}% |
|
|
\gdef\@tufte@stored@caption{}% |
|
|
\gdef\@tufte@stored@caption{}% |
|
|
|
|
|
\gdef\@tufte@caption@vertical@offset{0pt}% reset caption push |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
\newcommand{\@tufte@float@textwidth}[2]{% |
|
|
|
|
|
|
|
|
\newcommand{\@tufte@float@textwidth}[3][0pt]{% |
|
|
\ifthenelse{\NOT\boolean{@tufte@symmetric}\OR\boolean{@tufte@float@recto}}{% |
|
|
\ifthenelse{\NOT\boolean{@tufte@symmetric}\OR\boolean{@tufte@float@recto}}{% |
|
|
% asymmetric or page is odd, so caption is on the right |
|
|
% asymmetric or page is odd, so caption is on the right |
|
|
\hbox{% |
|
|
\hbox{% |
|
|
\usebox{#1}% |
|
|
|
|
|
|
|
|
\usebox{#2}% |
|
|
\hspace{\marginparsep}% |
|
|
\hspace{\marginparsep}% |
|
|
\smash{\usebox{#2}}% |
|
|
|
|
|
|
|
|
\smash{\raisebox{#1}{\usebox{#3}}}% |
|
|
}% |
|
|
}% |
|
|
}{% |
|
|
|
|
|
% symmetric pages and page is even, so caption is on the left |
|
|
|
|
|
|
|
|
}{% symmetric pages and page is even, so caption is on the left |
|
|
\hbox{% |
|
|
\hbox{% |
|
|
\smash{\usebox{#2}}% |
|
|
|
|
|
|
|
|
\smash{\raisebox{#1}{\usebox{#3}}}% |
|
|
\hspace{\marginparsep}% |
|
|
\hspace{\marginparsep}% |
|
|
\usebox{#1}% |
|
|
|
|
|
|
|
|
\usebox{#2}% |
|
|
}% |
|
|
}% |
|
|
}% |
|
|
}% |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
\newcommand{\@tufte@float@fullwidth}[2]{% |
|
|
|
|
|
|
|
|
\newcommand{\@tufte@float@fullwidth}[3][0pt]{% |
|
|
\ifthenelse{\equal{\floatalignment}{b}}% |
|
|
\ifthenelse{\equal{\floatalignment}{b}}% |
|
|
{% place caption above figure |
|
|
{% place caption above figure |
|
|
\ifthenelse{\NOT\boolean{@tufte@symmetric}\OR\boolean{@tufte@float@recto}}% |
|
|
\ifthenelse{\NOT\boolean{@tufte@symmetric}\OR\boolean{@tufte@float@recto}}% |
|
|
{\hfill\smash{\usebox{#2}}\par\usebox{#1}}% caption on the right |
|
|
|
|
|
{\smash{\usebox{#2}\hfill}\par\usebox{#1}}% caption on the left |
|
|
|
|
|
}% |
|
|
|
|
|
{% place caption below figure |
|
|
|
|
|
|
|
|
{\hfill\smash{\raisebox{#1}{\usebox{#3}}}\par\usebox{#2}}% caption on the right |
|
|
|
|
|
{\smash{\raisebox{#1}{\usebox{#3}}}\hfill\par\usebox{#2}}% caption on the left |
|
|
|
|
|
}{% place caption below figure |
|
|
\ifthenelse{\NOT\boolean{@tufte@symmetric}\OR\boolean{@tufte@float@recto}}% |
|
|
\ifthenelse{\NOT\boolean{@tufte@symmetric}\OR\boolean{@tufte@float@recto}}% |
|
|
{\usebox{#1}\par\hfill\smash{\usebox{#2}}}% caption on the right |
|
|
|
|
|
{\usebox{#1}\par\smash{\usebox{#2}\hfill}}% caption on the left |
|
|
|
|
|
|
|
|
{\usebox{#2}\par\hfill\smash{\raisebox{#1}{\usebox{#3}}}}% caption on the right |
|
|
|
|
|
{\usebox{#2}\par\smash{\raisebox{#1}{\usebox{#3}}}\hfill}% caption on the left |
|
|
}% |
|
|
}% |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|