Удалить пробел перед альбомной ориентацией

Удалить пробел перед альбомной ориентацией

Я вставляю landscapeцифру.

\begin{landscape}
\begin{figure}
\centering
\includegraphics[width=\linewidth]{figures/sensor_diffs.jpg}
\caption{Example of a single rep in which sensors are fused together to create a reaction time algorithm}
\label{fig:sensor_diffs}
\end{figure}

\begin{figure}
\centering
\includegraphics[width=\linewidth]{figures/sensor_diffs2.jpg}
\caption{Another example of a single rep in which sensors are fused together to create a reaction time algorithm}
\label{fig:sensor_diffs2}
\end{figure}
\end{landscape}

Однако страница перед рисунком производит много пустого пространства в конце. В том же разделе после рисунка много текста, однако, похоже, он не регулирует его должным образом.

Есть идеи?

Кроме того, эта проблема встречается в нескольких местах документа, поэтому любое глобальное решение было бы идеальным.

решение1

Для этого можно использовать afterpageпакет, чтобы рисунки набирались после заполнения текущей страницы.

\documentclass{article}
\usepackage{pdflscape}
\usepackage{graphicx}
\usepackage{afterpage}
\usepackage{lipsum}
\begin{document}
\lipsum[1-2]
\afterpage{%         <--------------like this
  \begin{landscape}
\begin{figure}
\centering
\includegraphics[width=\linewidth]{example-image}
\caption{Example of a single rep in which sensors are fused together to create a reaction time algorithm}
\label{fig:sensor_diffs}
\end{figure}

\begin{figure}
\centering
\includegraphics[width=\linewidth]{example-image-a}
\caption{Another example of a single rep in which sensors are fused together to create a reaction time algorithm}
\label{fig:sensor_diffs2}
\end{figure}
\end{landscape}
}
\lipsum
\end{document}

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

решение2

Я предлагаю вам загрузить rotatingпакет и его sidewaysfigureокружение, которое на жаргоне LaTeX называется "плавающим окружением". В отличие от этого, landscapeокружениенет\begin{landscape}плавающая среда, и именно поэтому при ее обнаружении происходит немедленный разрыв страницы .

Обратите также внимание, что (i) в одной среде может быть несколько изображений, каждое со своими операторами \captionи , и (ii) инструкции ничего не делают (и поэтому могут быть опущены), поскольку ширина графиков установлена ​​на .\labelsidewaysfigure\centering\linewidth

\documentclass{article}
\usepackage[demo]{graphicx}   % omit 'demo' option in real document
\usepackage{rotating}   % for 'sidewaysfigure' environment
\usepackage{lipsum}     % for filler text

\begin{document}

\lipsum[1-2]   % filler text

A cross-reference to Figures \ref{fig:sensor_diffs} and \ref{fig:sensor_diffs2}.

\begin{sidewaysfigure}   % this will show up on page 2

\includegraphics[width=\linewidth]{figures/sensor_diffs.jpg}
\caption{Example of a single rep in which sensors are fused together to create a reaction time algorithm}
\label{fig:sensor_diffs}

\vspace{2cm}  % get some vertical separation

\includegraphics[width=\linewidth]{figures/sensor_diffs2.jpg}
\caption{Another example of a single rep in which sensors are fused together to create a reaction time algorithm}
\label{fig:sensor_diffs2}

\end{sidewaysfigure}

\lipsum[3-7]   % more filler text, continued on page 1 and then on page 3
\end{document}

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