# How to set the dimensions of the document? [duplicate]

I would like to create with LaTeX a PDF document whose pages have prescribed dimensions. For instance, I would like to create a document whose pages have dimension 5cm x 5cm.

Is it possible, and if yes how would do that?

• look at the geometry package. It has lots of options. – David Carlisle Jun 19 '13 at 11:57
• I have looked quickly but, for instance, \documentclass{article} \usepackage[height=5cm, width=5cm, top=1cm, bottom=1cm, left=1cm, right=1cm]{geometry} \begin{document} test \end{document} won't do it, unfortunately. The size of the page seems to depend more on the class used. – Colas Jun 19 '13 at 12:08
• But, this \documentclass{article} \usepackage[paperheight=5cm, paperwidth=5cm, top=1cm, bottom=1cm, left=1cm, right=1cm]{geometry} \begin{document} test \end{document} is working perfectly ! – Colas Jun 19 '13 at 12:10

The answer is : with the geometry package.

For instance,

\documentclass{article}
\usepackage[paperheight=5cm,
paperwidth=5cm]{geometry}

\begin{document}
test
\end{document}


will make it.

• The margin settings have nothing to do with the goal of getting a certain paper size of the pdf file, so I removed those from your MWE. – Sverre Jun 19 '13 at 12:45