Graphics, Figures & Tables ⇒ Rotate image 90 or 270 depending on the side of the page
Rotate image 90 or 270 depending on the side of the page
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?
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
Rotate image 90 or 270 depending on the side of the page
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
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
Any idea why...
Code: Select all
\ifthenelse{\isodd{\value{page}}}{angle=90}{angle=270}