# Rotate odd pages 20deg, even -20deg

I have a 1000 page pdf that I'm trying to rotate the pages on. I can do this in InDesign but it would take forever, so I'm looking into tex.

Can this be done easily and how would I go about it?

I'm on a mac if it makes any difference and a total novice to tex. I have installed texbasic and TexWorks.

I came across this in my search:

\documentclass{article}
\usepackage{pdfpages}

\begin{document}
\includepdf[pages={-},angle=30]{main}
\end{document}


I edited "30" to "20" to get the angle then I edited "main" to the document name of my pdf and it worked!

However it is exporting all the pages at US Letter size and scaling my artwork up to suit. I need it not to scale my artwork.

• welcome to TEXSE. What have you tried so-far? The questions in this site must revolve around a certain specific problem. Nevertheless, the short answer is yes and you can look into the package pdfpages and graphics. – Raaja is not active on TEXSE Sep 13 '19 at 5:11
• – Ulrike Fischer Sep 13 '19 at 11:14
• Possible duplicate of Custom angle page rotation – Raaja is not active on TEXSE Sep 13 '19 at 14:26
• The linked question is indeed very related but it does not address how to apply different amounts of rotation for odd and even pages - so I voted to leave open. – Marijn Sep 13 '19 at 15:07
• See also stackoverflow.com/questions/29573189/… which has a Perl answer, I didn't test if it works but it would be trivial to alternate the amount of rotation between pages using this method. – Marijn Sep 13 '19 at 15:13

From the pdfpages documentation:

By default pages are scaled automatically. This can be suppressed with the noautoscale option. In combination with the scale option (from graphicx) the user has full control over the scaling process. Either true or false (or no value, which is equivalent to true). (Default: noautoscale=false)

So,

\documentclass{article}

\usepackage{pdfpages}

\begin{document}
\includepdf[pages={-},angle=20,noautoscale]{main}
\end{document}


If you want opposite angles for odd and even, you can loop through the pages and include odd/even pages using a condition:

\documentclass{article}

\usepackage{pdfpages}

\begin{document}

\includepdf[pages={-},angle=\ifodd\value{page} 20\else -20\fi,noautoscale]{main}

\end{document}


Or, perhaps a little more verbose:

\documentclass{article}

\usepackage{multido,pdfpages}

\begin{document}

\multido{\i=1+1}{1000}{%
\ifodd\i % \i is odd
\includepdf[pages=\i,angle=20,noautoscale]{main}%
\else % \i is even
\includepdf[pages=\i,angle=-20,noautoscale]{main}%
\fi
}

\end{document}