# Package-Conflict booklet and graphicx?

I'm trying to write a foldable booklet with LaTeX using the booklet package.

When I just compile text with the code shown below, everything works fine and the output PDF document appears in the expected shape: so landscape A4 pages, each showing two A5 textblocks (in "portrait orientation") sorted in such a way that the printed version can be folded into an A5 booklet with pages in the correct order. (so two portrait A5 pages on one landscape A4 sheet)

However, if I load the graphicx package in the header (even without actually inserting an image in the document), the output suddenly gives A4 pages in portrait orientation, showing the even-numbered pages (which are supposed to be on the left side of the paper sheet), but only a small part of the odd-numbered booklet pages, which are simply cut off at the edge of the A4 sized paper. (so attempting to place two portrait A5 pages on one portrait A4 sheet, which off course doesn't fit)

Does anyone know this problem and how to fix it?

\documentclass[11pt,a4paper]{article}
\usepackage[print]{booklet}
\usepackage{lipsum}
%\usepackage{graphicx}
\setpdftargetpages

\begin{document}

\lipsum
\lipsum
\lipsum
\lipsum
\lipsum
\lipsum
\lipsum
\lipsum

\end{document}


Here I added the File-List from the .log:

 *File List*
article.cls    2014/09/29 v1.4h Standard LaTeX document class
size11.clo    2014/09/29 v1.4h Standard LaTeX file (size option)
booklet.sty    2009/09/02 v0.7b booklet printing
bkltprnt.sty    2009/09/02 v0.7b support for booklet printing
lipsum.sty    2014/07/27 v1.3 150 paragraphs of Lorem Ipsum dummy text
graphicx.sty    2014/10/28 v1.0g Enhanced LaTeX Graphics (DPC,SPQR)
keyval.sty    2014/10/28 v1.15 key=value parser (DPC)
graphics.sty    2016/06/02 v1.0s Standard LaTeX Graphics (DPC,SPQR)
trig.sty    2016/01/03 v1.10 sin cos tan (DPC)
graphics.cfg    2016/06/04 v1.11 sample graphics configuration
pdftex.def    2016/06/17 v0.06h Graphics/color for pdfTeX
infwarerr.sty    2016/05/16 v1.4 Providing info/warning/error messages (HO)
ltxcmds.sty    2016/05/16 v1.23 LaTeX kernel commands for general use (HO)
supp-pdf.mkii
pdftexcmds.sty    2016/05/21 v0.22 Utility functions of pdfTeX for LuaTeX (HO)
ifluatex.sty    2016/05/16 v1.4 Provides the ifluatex switch (HO)
ifpdf.sty    2016/05/14 v3.1 Provides the ifpdf switch
epstopdf-base.sty    2016/05/15 v2.6 Base part for package epstopdf
grfext.sty    2016/05/16 v1.2 Manage graphics extensions (HO)
kvdefinekeys.sty    2016/05/16 v1.4 Define keys (HO)
kvoptions.sty    2016/05/16 v3.12 Key value format for package options (HO)
kvsetkeys.sty    2016/05/16 v1.17 Key value parser (HO)
etexcmds.sty    2016/05/16 v1.6 Avoid name clashes with e-TeX commands (HO)

• On my machine everything works fine in your MWE. Which LaTeX distribution do you use and on which version or rather which versions of the packages do you use? – Skillmon likes topanswers.xyz Jun 14 '17 at 16:27
• Thanks for your answer. I'm working with Miktex 2.9, my editor is TeXnicCenter. I'm not that familiar with the Package Manager since I use package installlation "on the fly" usually. But if I get it right install, my graphics package (can't find graphicx explicitly in the list) was installed in July 2016 and was packaged 2016-06-21. With "booklet" it's strange: it is listed packaged 2009-09-11, but it doesn't have an "installed" date in the Package Manager. However, I first loaded it a few days ago and it works (besides the graphic thing). – Girl Scientist Jun 15 '17 at 6:14
• For booklet.sty on my machine the version number is v0.7b dated to 2009-09-02 (you might have a look at the .sty-file in your tex-tree) and for graphicx.sty I have v1.0g dated to 2014-10-28. I haven't checked the other packages which are loaded by graphicx. I don't use Miktex, so I can't really help you much more with package installation etc. I'll ask in chat. – Skillmon likes topanswers.xyz Jun 15 '17 at 7:13
• Can you add \listfiles to your input and copy the resulting File List from the .log file into the question. – Joseph Wright Jun 15 '17 at 7:15
• How are you compiling? With pdflatex? Or latex+dvips+ps2pdf? Or something else? – Ulrike Fischer Jun 15 '17 at 8:50

This was a bug in pdftex.def which was fixed in v0.06j. The key comment there is
% If a package has changed \mag, assume it knows what it is doing

which is exactly what is going on here. Ideally, you'll update your TeX system to fix this. If that's not possible, probably best is to grab the latest pdftex.def from CTAN (it's part of the graphics-def bundle), and to put that where your sources are.
• I ran across this bug more recently, and had to use \AtBeginDocument{\setpdftargetpages} after \usepackage{graphicx} to fix it – John Kormylo Jan 11 at 16:47