[Tex/LaTex] Problem with margins in documentclass article and package graphicx

articlegraphicsmargins

I noticed that using the documentclass article and the package graphicx changes the displayed margins. Is that problem known and is it possible to avoid it?

Best Answer

graphicx (and some other packages like hyperref and geometry) actually corrects a problem. Without it it can happen that the pdf size shown by the pdf viewer is not equal to the internal \paperwidth and \paperheight. graphicx sets \pdfpagewidth and \pdfpageheight to avoid this problem. If you are getting the wrong page size, make sure that the option of the class actually reflects the page size you want:

\documentclass[a4paper]{article}
\usepackage{graphicx}
\begin{document}
abc
\end{document}