Graphics, Figures & TablesUnexpected (and unwanted) figure rotation?

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
blesht
Posts: 3
Joined: Sat Aug 14, 2010 5:29 pm

Unexpected (and unwanted) figure rotation?

Post by blesht »

I'm working on a long document that has many figures. Some I need to rotate (landscape) but most are just portrait. My document preamble is:

\documentclass[11pt,authoryear]{article}
\usepackage{pifont,natbib,geometry,fleqn,graphicx,txfonts} % Elsevier
\usepackage{lscape} % Embedded landscape figures/tables
\usepackage{url,listings,subfigure,array} % Useful things
\usepackage{lineno}
\usepackage{dcolumn}
\usepackage{rotating}
\usepackage{appendix}

I use the following for the figures I want landscape - works fine:

\begin{landscape}
\begin{figure}[!htp]
\caption{...caption text...}
\label{...figure label...}
\vspace{-12pt}
\begin{center}
\vspace{-12pt}
\subfigure{\includegraphics[scale=0.35]{subfiga.eps}}
\vspace{-12pt}
\subfigure{\includegraphics[scale=0.35]{subfigb.eps}}

[snip]

\end{center}
\end{figure}
\end{landscape}

Later in the document (after several other portrait oriented figures) I have the following:

\begin{figure}[!htp]
\caption{...thisFigCaption...}
\label{...thisFigLabel...}
\begin{center}
\vspace{-12pt}
\subfigure{\includegraphics[scale=0.35]{suba.eps}} \\
\vspace{-30pt}
\subfigure{\includegraphics[scale=0.35]{subb.eps}}
\subfigure{\includegraphics[scale=0.35]{subc.eps}} \\
\vspace{-30pt}
\subfigure{\includegraphics[scale=0.35]{subc.eps}}
\subfigure{\includegraphics[scale=0.35]{subd.eps}} \\
\vspace{-30pt}
\subfigure{\includegraphics[scale=0.35]{sube.eps}}
\subfigure{\includegraphics[scale=0.35]{subf.eps}}
\end{center}
\end{figure}

Which works fine (portrait) and is followed immediately by:

\begin{figure}[!htp]
\caption{...nextFigCaption...}
\label{...nextFigLabel...}
\begin{center}
%\vspace{-12pt} <- This caption is much shorter
\subfigure{\includegraphics[scale=0.35]{nextsuba.eps}} \\
\vspace{-30pt}
\subfigure{\includegraphics[scale=0.35]{nextsubb.eps}}
\subfigure{\includegraphics[scale=0.35]{nextsubc.eps}} \\
\vspace{-30pt}
\subfigure{\includegraphics[scale=0.35]{nextsubc.eps}}
\subfigure{\includegraphics[scale=0.35]{nextsubd.eps}} \\
\vspace{-30pt}
\subfigure{\includegraphics[scale=0.35]{nextsube.eps}}
\subfigure{\includegraphics[scale=0.35]{nextsubf.eps}}
\end{center}
\end{figure}

Which (mysteriously, at least to me) produces a rotated (landscape) figure. The subfigures are identical in size, etc. This section is followed by another in which the next figure appears properly in portrait orientation.

I'd really appreciate any help/suggestions to figure this out.

Thanks.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

CrazyHorse
Posts: 351
Joined: Sat Aug 02, 2008 8:47 am

Unexpected (and unwanted) figure rotation?

Post by CrazyHorse »

blesht wrote:I'm working on a long document that has many figures. Some I need to rotate (landscape) but most are just portrait. My document preamble is:
please post minimal examples and not endless code of
which 80% ist not of interest.

ps2pdf -dAutoRotatePages=/None <file>

or for Windows

ps2pdf -dAutoRotatePages#/None <file>

Herbert
blesht
Posts: 3
Joined: Sat Aug 14, 2010 5:29 pm

Re: Unexpected (and unwanted) figure rotation?

Post by blesht »

Sorry to have bothered you with uninteresting code - one never knows. Thanks (I guess) for the suggestion (sans explanation).
blesht
Posts: 3
Joined: Sat Aug 14, 2010 5:29 pm

Re: Unexpected (and unwanted) figure rotation?

Post by blesht »

Further note for anyone inclined to help me understand what is happening. If I increase the length of the figure caption by several lines (keeping everything else the same) the page that had been unexpectedly rotated to landscape appears correctly in portrait orientation.
CrazyHorse
Posts: 351
Joined: Sat Aug 02, 2008 8:47 am

Unexpected (and unwanted) figure rotation?

Post by CrazyHorse »

blesht wrote:Further note for anyone inclined to help me understand what is happening. If I increase the length of the figure caption by several lines (keeping everything else the same) the page that had been unexpectedly rotated to landscape appears correctly in portrait orientation.
ghostscript is sometimes too clever here. It thinks that the image
should be rotated and do not know that it is already done by the user.
This is the default behaviour of ghostscript.

Herbert
Post Reply