I tried searching the forums for my solution but my key words turned up nothing. I have some large images included in my document and it is my desire that they consume the whole page in landscape. I have achieved this by using the align=90 argument. No problem there.
Now, I want to supply either 90 degrees or 270 degrees depending on which side of the book it is on (right or left). I want the image bottom always facing the binding. I know about the ifthen package and I believe I could probably make this work if I only knew how to test for the side of the page that the image was on.
Thoughts?
Graphics, Figures & Tables ⇒ Rotate image 90 or 270 depending on the side of the page
NEW: TikZ book now 40% off at Amazon.com for a short time.

Rotate image 90 or 270 depending on the side of the page
I've pieced together something but it doesn't typeset. If you typeset the bit below it will spit out angle=90 on page 1 and angle=270 on page 2. That's correct behavior. However, if I try to use it to dynamically supply the angle= argument to \includegrpahics then it fails (remove the begin/end comment to experience this behavior).
Any suggestions?
Code: Select all
\documentclass[11pt]{book}
\usepackage{graphicx}
\usepackage{ifthen}
\usepackage{comment}
\begin{document}
\begin{comment}
\begin{figure}[ht!]
\begin{center}
\includegraphics[width=7.5in,\ifthenelse{\isodd{page}}{angle=90}{angle=270} ]{flashcamdx_logo_proof}
\caption{Top view of the device.}
\label{fig:Internal Features Top View}
\end{center}
\end{figure}
\end{comment}
\ifthenelse{\isodd{\value{page}}}{angle=90}{angle=270}
\newpage
\ifthenelse{\isodd{\value{page}}}{angle=90}{angle=270}
\end{document}
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Rotate image 90 or 270 depending on the side of the page
This is no good idea and besides typographical nonsense. The captions and therewith the bottom of the figures should either point to the outer margin or in one direction (left or right). Perhaps another approach by the rotating package is satisfactory for you.jorsborn wrote:[…] I want the image bottom always facing the binding. […]
Code: Select all
\documentclass[11pt,twoside]{article}
\usepackage[T1]{fontenc}
\usepackage{rotating}
\begin{document}
\begin{sidewaysfigure}[!ht]
\centering
\rule{12.8cm}{7.2cm}
\caption{Dummy figure}\label{fig:dummy-1}
\end{sidewaysfigure}
\begin{sidewaysfigure}[!ht]
\centering
\rule{12.8cm}{7.2cm}
\caption{Dummy figure}\label{fig:dummy-2}
\end{sidewaysfigure}
\end{document}
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Rotate image 90 or 270 depending on the side of the page
Let's say that it wasn't a bad idea or typographical nonsense for the sake of learning.
Any idea why...
... doesn't expand inside the arguments for \includegraphics?
Any idea why...
Code: Select all
\ifthenelse{\isodd{\value{page}}}{angle=90}{angle=270}