刪除橫向之前的空白

刪除橫向之前的空白

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

您可以使用afterpagepackage 來實現此目的,以便在填入目前頁面後排版圖形。

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

相關內容