I cannot get my caption left justified correctly for wide floats. I have facing pages, and after many experiments, the closest I've come to success is a proper layout only for odd pages.
I would like both the wide figure and and the caption to be left justified on the page. I would like the caption to be much less wide that the float.
Here's my MWE:
\documentclass[openright,twoside]{book}
\usepackage[facing=yes]{floatrow}
\usepackage{caption}
\usepackage{lipsum}
\usepackage{tabulary}
%%
% Set page layout geometry
% The asymmetric option keeps the margin notes always on the same side of the page which is the way Tufte does it.
\RequirePackage[
letterpaper,
asymmetric,
includemp,
inner=0.5in,
bindingoffset=1.0in,
width=6.75in,
marginparsep=0.25in,
marginparwidth=2in,
showframe,
] {geometry}
\floatsetup[widefloat]
{
floatwidth=6.75in,
objectset=raggedright,
}
%
\captionsetup[widefloat]
{
margin={0pt,2.25in},
justification=justified,
font=small
}
\begin{document}
\lipsum[2]
\begin{table*}[ht]
\begin{tabulary}{\linewidth}{|L|l|l|l|l|l|l|}
\hline
foofoofoo & barbarbar & foofoofoo & barbarbar & foofoofoo & barbarbar & foofoofoo \\
\hline
\end{tabulary}
\caption{Pellentesque habitant morbi tristique senectus et netus et malesuada
fames ac turpis egestas. Donec odio elit, dictum in, hendrerit sit amet,
egestas sed, leo. Praesent feugiat sapien aliquet odio. Integer vitae justo.}
\end{table*}
\clearpage
\lipsum[2]
\begin{table*}[ht]
\begin{tabulary}{\linewidth}{|L|l|l|l|l|l|l|}
\hline
foofoofoo & barbarbar & foofoofoo & barbarbar & foofoofoo & barbarbar & foofoofoo \\
\hline
\end{tabulary}
\caption{Pellentesque habitant morbi tristique senectus et netus et malesuada
fames ac turpis egestas. Donec odio elit, dictum in, hendrerit sit amet,
egestas sed, leo. Praesent feugiat sapien aliquet odio. Integer vitae justo.}
\end{table*}
\end{document}
Here's the trouble I get into (showframe
is on). Notice that the wide table is correctly flushed left, but the caption is hanging on the wrong side.
----- EDIT -----
As far as I can tell, floatrow
has a bug swizzling left and right margins. This hack uses the changepage
package to undo the margin swizzle:
\newcommand{\widecapfix}
{
\checkoddpage
\ifoddpage
\captionsetup{margin={0in,2.25in}}
\else
\captionsetup{margin={2.25in,0in}}
\fi
}
So, I must insert \widecapfix
into each wide figure usage just above the caption. Pretty gross I think.