General ⇒ Force images/tables to verso
-
- Posts: 4
- Joined: Sun Feb 17, 2008 2:34 pm
Force images/tables to verso
I'd like my tables/images on the left and my text on the right.
Thanks!
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
Force images/tables to verso
Code: Select all
\documentclass[twoside]{article}
%-----------------------------------------------------------------------------
% Put this block in the preamble
% This package defines the \EveryShipout command
\usepackage{everyshi}
% We redefine some parameters to avoid floats on even pages (twosided document)
\EveryShipout{\ifodd\value{page}\gdef\topfraction{0.7}\else\gdef\topfraction{0}\fi}
\EveryShipout{\ifodd\value{page}\gdef\bottomfraction{0.3}\else\gdef\bottomfraction{0}\fi}
\EveryShipout{\ifodd\value{page}\gdef\textfraction{0.2}\else\gdef\textfraction{1}\fi}
\EveryShipout{\ifodd\value{page}\gdef\floatpagefraction{0.5}\else\gdef\floatpagefraction{1}\fi}
\gdef\topfraction{0}\gdef\bottomfraction{0}\gdef\textfraction{1}\gdef\floatpagefraction{1}
%-----------------------------------------------------------------------------
% Only for testing purposes
\usepackage{lipsum} % To generate text
\newcommand{\InsertAFigure}{% To generate figures
\begin{figure}
\centering \fbox{\parbox[][5cm][c]{5cm}{\centering A figure}}
\caption{A figure}
\end{figure}}
\begin{document}
\lipsum[1-3] \InsertAFigure
\lipsum[1-3] \InsertAFigure \InsertAFigure
\lipsum[1-3] \InsertAFigure
\lipsum[1-3] \InsertAFigure
\lipsum[1-3] \InsertAFigure \InsertAFigure
\lipsum[1-3] \InsertAFigure
\lipsum[1-3] \InsertAFigure
\lipsum[1-3] \InsertAFigure \InsertAFigure \InsertAFigure
\lipsum[1-3] \InsertAFigure
\lipsum[1-3] \InsertAFigure
\lipsum[1-3] \InsertAFigure
\lipsum[1-3] \InsertAFigure \InsertAFigure
\lipsum[1-3] \InsertAFigure
\lipsum[1-3] \InsertAFigure
\lipsum[1-10]
\end{document}
Code: Select all
\EveryShipout{\ifodd\value{page}\gdef\textfraction{0.2}\else\gdef\textfraction{1}\fi}
-
- Posts: 2
- Joined: Sat Dec 13, 2008 8:38 pm
Re: Force images/tables to verso
Apologies for dragging up an old post, but the original question is exactly the same one as I'm now trying to solve! The above solution nearly works for me (with the line removed as described) but text still appears on left hand pages when there are no figures. I'd like to be able to have all the text on the right, leaving left pages blank if required.
As an added complication, if its possible I'd like to be able to define some smaller floats to go inline using text wrapping.
Thanks for your help in advance.
Force images/tables to verso
Perhaps you may try a more exigent set of parameters:I'd like to be able to have all the text on the right, leaving left pages blank if required.
Code: Select all
\EveryShipout{\ifodd\value{page}\gdef\topfraction{1}\else\gdef\topfraction{0}\fi}
\EveryShipout{\ifodd\value{page}\gdef\bottomfraction{1}\else\gdef\bottomfraction{0}\fi}
\EveryShipout{\ifodd\value{page}\gdef\textfraction{0}\else\gdef\textfraction{1}\fi}
\EveryShipout{\ifodd\value{page}\gdef\floatpagefraction{0}\else\gdef\floatpagefraction{1}\fi}
\gdef\topfraction{0}\gdef\bottomfraction{0}\gdef\textfraction{1}\gdef\floatpagefraction{1}
Code: Select all
\newcommand{\InsertPhantomFigure}{\begin{figure}[p]\phantom{x}\end{figure}}
Don't use the figure or table environment for this. Just directly include graphics with \includegraphics or tables with tabular. You may add captions with the \captionof command defined in the capt-of or caption packages.As an added complication, if its possible I'd like to be able to define some smaller floats to go inline using text wrapping.
-
- Posts: 2
- Joined: Sat Dec 13, 2008 8:38 pm