删除横向之前的空白

删除横向之前的空白

我正在插入一个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}

相关内容