[Tex/LaTex] control margins with geometry or fullpage

geometrymargins

Is there a better way to set

\topmargin
-1.5cm
\textwidth
15.5cm
\textheight
23.5cm
\oddsidemargin
0.7cm
\evensidemargin
1.2cm

perhaps using \usepackage{geometry} or \usepackage{fullpage}?
What are the options to be invoked?

Best Answer

This is easily done, as @ChristianHupfer said, using the geometry package.

It has a nice way to set the margins while calling the usepackage directive. While a full answer, detailing all of the option is in the package manual, here is a shortcut specific for your answer. Since you provide oddsidemargin and evensidemargin I assume you have a twoside document.

\documentclass{article}
\usepackage[width=15.5cm,
            height=23.5cm,
            top=1.5cm,
            inner=0.7cm,
            outer=1.2cm]{geometry}
\begin{document}

 \end{document}

I used also a4paper as a documentclass option and the showframe package in order to show the frame for my example. Please double check that your margins are alright for whatever paper size you are using. Also, the geometry package has nice papersize options I invite you to checkout

enter image description here