The tufte-latex
class has a page layout with a wide margin on the side; the class redefines the figure and table environments so that the captions are put in the margin, side to side with the floating environment.
Here's an excerpt from the sample-book.pdf
file:
However, there's a problem when using the longtable environment.
Since it cannot be put inside a table environment, it loses the caption in the margin.
Longtable in fact has a \caption{}
command, but it allows the caption to be placed only on top on the table, not on the side (that is, in the margin):
How can I have a longtable with the caption in the margin?
tufte-latex
places the caption in the margin, aligned with the top of the floating environment, and it can be serif (default) or sans-serif (\sffamily
).
I'm aware of this answer, but it does not solve the problem completely, as the longtable caption does not inherit the format of the other captions.
A MWE as requested (longtable
with the wrong caption):
\documentclass{tufte-book}
\usepackage{booktabs}
\usepackage{longtable}
\begin{document}
\begin{table}[h]
\centering
\begin{tabular}{lcr}
\toprule
Heading & Style & Size \\
\midrule
Part & roman & {40} \\
Chapter & italic & {40} \\
Section & italic & {26} \\
Subsection & italic & {26} \\
Paragraph & italic & 10/14 \\
\bottomrule
\end{tabular}
\caption{Heading styles used in.}
\end{table}
\begin{longtable}{lcccc}
\caption{Verification methods.}\\
\toprule
Requirement id & Review of design & Analysis & Inspection & Test \\
\toprule
\endfirsthead
\toprule
Requirement id & Review of design & Analysis & Inspection & Test \\
%\otoprule
\endhead
\bottomrule
\endfoot
One & * & & & \\
\midrule
Two & * & & & \\
\midrule
Three & * & & & \\
\midrule
Four & * & & & \\
\end{longtable}
\end{document}
Best Answer
Basically you can use the code in the referenced answer but replace the
\raggedright
by the formatting the Tufte class uses. I don't really know that class but using\tracingall
suggests that this produces the same formatting (but the class may have higher level access to these settings)