Изображение переносится на следующую страницу с сохранением правила полей в tufte-book

Изображение переносится на следующую страницу с сохранением правила полей в tufte-book

Я использую tufte-bookшаблон и у меня возникла определенная проблема, когда изображения переходят с одной страницы на другую, так как я использую raggedouterопцию for marginalsв классе документа.

Я уже пытался найти помощь по этому вопросу в сообществе, но, возможно, я использую не совсем корректные термины для поиска помощи по этому вопросу, и я пока ничего не нашел... Есть ли кто-нибудь, кто может мне в этом помочь?

Я приведу вам отрывок из моего кода, где выполняется включение этой фигуры.

To summarize, in figure~\ref{fig:rank-libraries-full} one can see the current state of the implementation of Rank's libraries of \texttt{rankd-comp} for computing resources, \texttt{rankd-net} for network resources, and \texttt{rankd-time} for timing resources and \acl{tsn} configurations.

\begin{figure*}[h]
    \centering
    %\includegraphics[width=.75\columnwidth]{figs/rank-libraries.pdf}
    \missingfigure[figwidth=\textwidth]{The full integration of components and interactions within the scope of the Rank metrics gatherer libraries}
    \caption{The full integration of components and interactions within the scope of the Rank metrics gatherer libraries}
    \label{fig:rank-libraries-full} 
\end{figure*}

With all the metrics already gathered we can now assess the capabilities of a given machines towards the execution or the schedulability of a given service.

Заполнитель изображения является результатом использования \missingfigureкоманды из todonotesпакета.

Есть ли способ сохранить эту raggedouterопцию и заставить это изображение (и другие, поскольку это часто происходит в остальной части документа) следовать за полями следующей страницы, на которой размещено плавающее изображение?

Большое вам спасибо за вашу помощь!

Проблема с изображением, когда плавающее изображение нарушает правило рваного внешнего изображения

решение1

Обратите внимание, что если вы загрузите пакет ifoddpage, tufte-book будет его использовать ( \oddpage@labelбудет отображаться в файле aux). Однако он запускается \checkoddpageв начале, @tufte@floatа не внутри, lrboxгде ему и положено. Для обработки изменений требуется два запуска.

\documentclass[symmetric,marginals=outer]{tufte-book} 
\usepackage{ifoddpage}
\usepackage{lipsum}

\makeatletter
\renewenvironment{@tufte@float}[3][htbp]%
  {% begin @tufte@float
    % Should this float be full-width or just text-width?
    \ifthenelse{\equal{#3}{star}}%
      {\gsetboolean{@tufte@float@star}{true}}%
      {\gsetboolean{@tufte@float@star}{false}}%
    % Check page side (recto/verso) and store detected value -- can be overriden in environment contents
    \stepcounter{checkoddpage}% checkoddpage come later
    \ifoddpage
      \setboolean{@tufte@float@recto}{true}\@tufte@float@debug{Detected page: [recto/odd]}% make changes local
    \else
      \setboolean{@tufte@float@recto}{false}\@tufte@float@debug{Detected page: [verso/even]}%
    \fi
    \addtocounter{checkoddpage}{-1}%
    % If the float placement specifier is 'b' and only 'b', then bottom-align the mini-pages, otherwise top-align them.
    \renewcommand{\@tufte@fps}{#1}%
    \@tufte@float@debug{Allowed positions: [#1]}%
    \ifthenelse{\equal{#1}{b}\OR\equal{#1}{B}}%
      {\renewcommand{\floatalignment}{b}\@tufte@float@debug{Presumed position: [bottom]}}%
      {\renewcommand{\floatalignment}{t}\@tufte@float@debug{Presumed position: [top]}}%
    % Capture the contents of the \caption and \label commands to use later
    \global\let\@tufte@orig@caption\caption%
    \global\let\@tufte@orig@label\label%
    \renewcommand{\caption}{\optparams{\@tufte@caption}{[][0pt]}}%
    \renewcommand{\label}[1]{\@tufte@label{##1}}%
    % Handle subfigure package compatibility
    \ifthenelse{\boolean{@tufte@packages@subfigure}}{%
      % don't move the label while inside a \subfigure or \subtable command
      \global\let\label\@tufte@orig@label%
    }{}% subfigure package is not loaded
    \@tufte@orig@float{#2}[#1]%
    \ifthenelse{\boolean{@tufte@float@star}}%
      {\setlength{\@tufte@float@contents@width}{\@tufte@fullwidth}}%
      {\setlength{\@tufte@float@contents@width}{\textwidth}}%
    \begin{lrbox}{\@tufte@figure@box}%
      \checkoddpage
      \begin{minipage}[\floatalignment]{\@tufte@float@contents@width}\hbox{}%
  }{% end @tufte@float
      \par\hbox{}\vspace{-\baselineskip}\ifthenelse{\prevdepth>0}{\vspace{-\prevdepth}}{}% align baselines of boxes
      \end{minipage}%
    \end{lrbox}%
    % build the caption box
    \begin{lrbox}{\@tufte@caption@box}%
      \begin{minipage}[\floatalignment]{\marginparwidth}\hbox{}%
        \ifthenelse{\NOT\equal{\@tufte@stored@caption}{}}{\@tufte@orig@caption[\@tufte@stored@shortcaption]{\@tufte@stored@caption}}{}%
        \ifthenelse{\NOT\equal{\@tufte@stored@label}{}}{\@tufte@orig@label{\@tufte@stored@label}}{}%
        \par\vspace{-\prevdepth}%% TODO: DOUBLE-CHECK FOR SAFETY
      \end{minipage}%
    \end{lrbox}%
    % now typeset the stored boxes
    \begin{fullwidth}%
      \begin{minipage}[\floatalignment]{\linewidth}%
        \ifthenelse{\boolean{@tufte@float@star}}%
          {\@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{fullwidth}%
    \@tufte@orig@endfloat% end original LaTeX float environment
    % output debug info
    \ifthenelse{\boolean{@tufte@debug}}{%
      \typeout{^^J^^J----------- Tufte-LaTeX float information ----------}%
      \ifthenelse{\equal{\@tufte@stored@label}{}}%
        {\typeout{Warning: Float unlabeled!}}%
        {\typeout{Float label: [\@tufte@stored@label]}}%
      \typeout{Page number: [\thepage]}%
      \def\MessageBreak{^^J}%
      \typeout{\@tufte@float@debug@info}%
      \ifthenelse{\boolean{@tufte@symmetric}}%
        {\typeout{Symmetric: [true]}}%
        {\typeout{Symmetric: [false]}}%
      \typeout{----------------------------------------------------^^J^^J}%
    }{}%
    % reset commands and temp boxes and captions
    \gdef\@tufte@float@debug@info{}%
    \let\caption\@tufte@orig@caption%
    \let\label\@tufte@orig@label%
    \begin{lrbox}{\@tufte@figure@box}\hbox{}\end{lrbox}%
    \begin{lrbox}{\@tufte@caption@box}\hbox{}\end{lrbox}%
    \gdef\@tufte@stored@shortcaption{}%
    \gdef\@tufte@stored@caption{}%
    \gdef\@tufte@stored@label{}%
    \gsetlength{\@tufte@caption@vertical@offset}{0pt}% reset caption offset
  }
 \makeatother

\begin{document}

\rule{1em}{37\baselineskip}

To summarize, in figure~\ref{fig:rank-libraries-full} one can see the current state of the implementation of Rank's libraries of \texttt{rankd-comp} for computing resources, \texttt{rankd-net} for network resources, and \texttt{rankd-time} for timing resources and \verb|\acl{tsn}| configurations.

\begin{figure*}[h]
    \centering
    %\includegraphics[width=.75\columnwidth]{figs/rank-libraries.pdf}
    \verb|\missingfigure[figwidth=\textwidth]|{The full integration of components and interactions within the scope of the Rank metrics gatherer libraries}
    \caption{The full integration of components and interactions within the scope of the Rank metrics gatherer libraries}
    \label{fig:rank-libraries-full} 
\end{figure*}

With all the metrics already gathered we can now assess the capabilities of a given machines towards the execution or the schedulability of a given service.

\lipsum[1]
\end{document}

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