хаос с плавающими и заголовочными полями

хаос с плавающими и заголовочными полями

Я не могу правильно выровнять подпись по левому краю для широких плавающих страниц. У меня разворотные страницы, и после многих экспериментов, самое близкое, к чему я пришел, — это правильная компоновка только для нечетных страниц.

Я бы хотел, чтобы и широкая фигура, и подпись были выровнены по левому краю страницы. Я бы хотел, чтобы подпись была намного менее широкой, чем float.

Вот мой 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}

Вот в какую беду я попал (showframe(вкл.) Обратите внимание, что широкая таблица правильно выровнена по левому краю, но подпись висит не на той стороне.

введите описание изображения здесь

----- РЕДАКТИРОВАТЬ -----

Насколько я могу судить,floatrowимеет баг, который смещает левые и правые поля. Этот хак используетchangepageпакет для отмены изменения маржи:

\newcommand{\widecapfix}
{
    \checkoddpage
    \ifoddpage
        \captionsetup{margin={0in,2.25in}}
    \else
        \captionsetup{margin={2.25in,0in}}
    \fi
}

Так что я должен вставить \widecapfixв каждую широкую фигуру использование прямо над подписью. Довольно отвратительно, я думаю.

решение1

Если вы готовы перевести свои таблицы из среды в командную структуру, я изменил boxhandlerпакетную процедуру, чтобы достичь, как я думаю, желаемого вами результата. Изменения, которые мне пришлось внести в команду, \ReciteTableбыли двоякими: мне пришлось поместить заголовок таблицы после, а не перед содержимым таблицы; и мне пришлось принудительно выровнять заголовок по левому краю относительно слишком большой таблицы.

\documentclass[openright,twoside]{book}
\usepackage{lipsum}
\usepackage{tabulary}
\usepackage{boxhandler}

%%
% 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}

\makeatletter
\renewcommand\ReciteTable[6][ht]{%
  \begin{table}[#1]%
    \begin{\LRTablePlacement}%
      \let\@makecaption\new@makecaption%
      \setlength\abovecaptionskip{\arabic{abovecaptionskipterm}\p@}%
      \setlength\belowcaptionskip{\arabic{belowcaptionskipterm}\p@}%
        \set@DataBoxWidth{#3}%
        \setlength\CaptionBoxWidth{#4}%
        \set@BoxOffsets%
        \if T#6%
          \rule{\@DataBoxOffset}{0in}%
          \makebox[\@DataBoxWidth][l]{#5}%
          \rule{\@DataBoxOffset}{0in}\\%
        \fi
        \rule{\@DataBoxOffset}{0in}%
        \usebox{#3}%
        \rule{\@DataBoxOffset}{0in}\\%
        \par%
        \parbox{\CaptionBoxWidth}{\bx@caption{#2}}%
        \rule{\@CaptionBoxOffset}{0em}%
        \rule{\@CaptionBoxOffset}{0em}%
        \if T#6%
          \rule{\@DataBoxOffset}{0in}\\%
          \makebox[\@DataBoxWidth][r]{#5}%
        \rule{\@DataBoxOffset}{0in}%
        \fi
      \let\@makecaption\old@makecaption%
      \setlength\abovecaptionskip \oldabovecaptionskip%
      \setlength\belowcaptionskip \oldbelowcaptionskip%
    \end{\LRTablePlacement}%
  \end{table}%
}
\makeatother

\begin{document}

\lipsum[2]

\constrainCaptionWidth{\textwidth}
\captionStyle{n}{l}
\setlength\TableDeadMargin{0em}

\bxtable[ht]{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.}
{%
\normalsize
    \begin{tabulary}{6.75in}{|L|l|l|l|l|l|l|}
        \hline
        foofoofoo & barbarbar & foofoofoo & barbarbar & foofoofoo & barbarbar & foofoofoo \\
        \hline
        \end{tabulary}
}

\clearpage
\lipsum[2]

\bxtable[ht]{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.}
{%
\normalsize
    \begin{tabulary}{6.75in}{|L|l|l|l|l|l|l|}
        \hline
        foofoofoo & barbarbar & foofoofoo & barbarbar & foofoofoo & barbarbar & foofoofoo \\
        \hline
        \end{tabulary}
}

\end{document}

Связанный контент