# Issues with page size using memoir

I am using LaTeX to typeset my wife's book and was having no problems until recently. I have the file set up to produce a 6x9 page size and was working fine. When I upgraded my computer to the latest version of Ubuntu (17.04) the pages are now coming out as 8.5x11, but only if \include{graphicx} is used, and only with the memoir document class. It is also happening on my windows box with Miktex, both of which were working fine until the upgrade.

\documentclass{memoir}
\usepackage[paperwidth=6in,paperheight=9in]{geometry}
\usepackage{lipsum}

\begin{document}
\lipsum[1-6]
\end{document}


This code works fine, producing a pdf with a page size of 6x9, but when I add \usepackage{graphicx}:

\documentclass{memoir}
\usepackage[paperwidth=6in,paperheight=9in]{geometry}
\usepackage{graphicx}
\usepackage{lipsum}
\begin{document}
\lipsum[1-6]
\end{document}


it goes to 8.5 x 11. I have tried adding \pdfpagewidth=6in \pdfpageheight=9in and it has no effect. Has there been a change to the memoir class or the graphicx? Is there an alternative to graphicx? Or a different way to set the page size?

• Welcome to TeX.SE! Why you not use memoir's functions for determining page layout? – Zarko Jul 3 '17 at 22:21
• I knew it was in there somewhere. Use the memoir class option ebook, that sets the stock size to 6x9 in. – daleif Jul 4 '17 at 5:07

The problem is that pdftex.def (for many years actually) detects memoir's \stockwidth length and uses that in preference to \paperwidth if it is set.

If you used memoir facilities this would be set up but a quick fix would be

\documentclass{memoir}
\usepackage[paperwidth=6in,paperheight=9in]{geometry}
\usepackage{graphicx}

\stockwidth\paperwidth
\stockheight\paperheight
\usepackage{lipsum}
\begin{document}
\lipsum[1-6]
\end{document}

• @AlanMunn well yes/no that's rather the point, if you use the memoir way, you don't need this at all, so this is just how to fix things up having got that far without using the memoir page setup. – David Carlisle Jul 4 '17 at 6:58
• \setstocksize{9in}{6in} worked. Many thanks and some hair may grow back. I didn't even realize the memoir class had this function, and it works without the fix on my Mac. It's good to know how to fix it in the future if it shows up again. I will really have to read through the entire 600 pages of the memoir manual at some point. – Ward Edwards Jul 5 '17 at 1:04

There is no need for geometry in this case, not even manually setting the sizes. Just issue the memoir class option ebook this sets the stock and such sequentially the paper size to 6x9 in.

Then if you need to change the margins use for example

\setlrmarginsandblock{left} {right} {ratio}
\setulmarginsandblock{top} {bottom} {ratio}
\checkandfixthelayout


Note that in the three arg combos exactly one arg has to be *

• Thanks for another option. I think I prefer using the \setstockwidth as it gives me more options if I want to print in a different size. – Ward Edwards Jul 5 '17 at 1:21