I observed a strange issue if you combine the graphicx package and a41.sty. The page size changes if I compile the document using pdflatex

Disclaimer: I know that using a41.sty is heavily outdated and deprecated. It's not my choice to use it and I'm afraid its beyond my authority to switch to more modern ways to adjust the paper size to A4. I'd just like to understand the interference of these two packages under the given constraints.

Expected behaviour

By using a41.sty the paper size should be changed to A4 and the margins should be adjusted to be rather small. Including the graphicx package should not change anything about the page size.

Observed behaviour

As long as I only include a41.sty the margins look as expected. When I include the graphicx package and use pdflatex to compile the document, the page size becomes significantly smaller and the page number is placed quite close to the border of the page. Using latex, however, both versions (with and without graphicx) produce the same output.

Output with graphicx

Output without graphicx


Can anyone explain what exactly is happening here? Is there a way to avoid this problem (besides switching to geometry or typearea)?

Minimal working example

\usepackage{lipsum} % for filler text
% insert filler text


Since it's not very widespread here is the contents of a41.sty:

% Correction for A4 paper (297x210mm) instead of the american 11x8.5in.         
% To be called, for example, in this way:                                       
%                 \documentstyle[12pt,A4]{article}                              

graphics (and geometry and one or two other modern (ie, post pdftex) packages) pass the values of \paperheight and \paperwidth to the PDF output as \pdfpageheight and \pdfpagewidth so that a PDF viewer uses the intended page size.

If you use the standard [a4paper]option on the documentclass these would be set to A4 but as you have not, the default USLetter size is being used.

The comment in the file betrays its age


That is latex2.09 usage so pre 1993. there isn't really any reason to use that now, use the geometry package instead.

  • Thanks for the explanation concerning \pdfpageheight. This piece of information actually helped to convince the other people on the project to finally switch to the geometry package. I ended up using \usepackage[a4paper,textwidth=490.0pt,textheight=703.1pt]{geometry} to keep the exact dimensions of the text area of the a41.sty given above (for compatibility). To find out these values I used \showthe\textwidth and \showthe\textheight (see this question) in the old document while using a41.sty. – arnd Apr 28 '15 at 19:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.