Eliminar espacios en blanco antes del paisaje

Eliminar espacios en blanco antes del paisaje

Estoy insertando una landscapefigura.

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

Sin embargo, la página anterior a la figura produce muchos espacios en blanco al final. Hay mucho texto en la misma sección después de la figura, sin embargo, no parece ajustarlo correctamente.

¿Algunas ideas?

Además, tengo este problema en varios lugares del documento, por lo que cualquier tipo de solución global sería ideal.

Respuesta1

Puede usar afterpageel paquete para esto para que las figuras se compongan después de llenar la página actual.

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

ingrese la descripción de la imagen aquí

Respuesta2

Le sugiero que cargue el rotatingpaquete y su sidewaysfigureentorno, que es un "entorno flotante" en la jerga de LaTeX. En cambio, el landscapemedio ambiente esnoun entorno flotante, y es por eso que obtienes el salto de página inmediato cuando \begin{landscape}lo encuentras.

Observe también que (i) es posible tener varias imágenes, cada una con sus propias \captiondeclaraciones \label, en un solo sidewaysfigureentorno, y (ii) las \centeringinstrucciones no hacen nada (y por lo tanto pueden omitirse) ya que los anchos de los gráficos están establecidos a \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}

información relacionada