Configure default paper size in LaTeX
If you use LaTeX and produce PDF’s in the U.S. you may find that your documents are being produced on A4 paper instead of letter paper even though you have defined letterpaper in your document class. If you create just DVI output it works correctly, but as soon as you convert to PDF, or use pdftex, the document is still on A4. What’s going on?
Believe it or not, it doesn’t really matter which PDF generation mechanism you are using, all work in the same manner and therefore exhibit the same behavior. Whether it’s pdftex, dvipdfm, or ps2pdf, all don’t/can’t use the document class paper size definition. So if that’s all that’s been set, that’s not enough.
There’s two equally simple solutions:
- Next to your document class, add these additional parameters
1 2
\pdfpagewidth 8.5in \pdfpageheight 11.0in
Of course this could be customized to any size paper you wish, but it’s simple and easy enough to include in a template for all future documents.
- If you’re using a LaTeX distribution like TeX Live and want to make sure everything produced is on letter paper, run the
texconfigcommand.jhowk@host:~$ texconfig paper letter texconfig: updated configuration saved as file `/home/jhowk/.texmf-config/dvips/config/config.ps' texconfig: updated configuration saved as file `/home/jhowk/.texmf-config/dvipdfm/config/config' texconfig: updated configuration saved as file `/home/jhowk/.texmf-config/dvipdfm/config/dvipdfmx.cfg' texconfig: updated configuration saved as file `/home/jhowk/.texmf-config/xdvi/XDvi' texconfig: updated configuration saved as file `/home/jhowk/.texmf-config/tex/generic/config/pdftexconfig.tex' ...
You’ll get a ton of output, but rest assured you’ve set your default paper size to letter. Using texconfig is not setting a system-wide command and only configured the user who ran it. To undo, just remove the .texmf-config and .texmf-var directories in the users home directory. Texconfig is also has a curses based gui if you run it without any parameters.
There it is. Two simple solutions for an issue that unfortunately I’ve run into more than once before…
Thank you. Hasn’t been an issue until we had a printer that actively complained about not having A4 paper to print an A4 PDF, and that was smart enough to know the difference in its paper tray.
thanks! it took me so long!
This has to be one of the most actual useful pieces of information on the net. thank you.
Very useful, thanks much!!