# jerichoblog

linux and windows tips, mathematics, and some recipes

## Saturday, February 25, 2006

### Simple Margin Adjustment in LaTeX

LaTeX enforces beauty upon its documents, sometimes to the detriment of practicality. By default, LaTeX margins are extremely generous. This leads to good-looking documents, but there are occasions when it may be better to have smaller margins —— for instance, if you want a document to fit entirely within one page.

Page layout with LaTeX is a complicated matter. A cursory glance at the LaTeX documentation shows that the layout is determined by 11 different parameters. However, I find that the following commands are sufficient for most purposes:

where a, b, c are numerical quantities such that a=2b. The effect of these commands is to increase the extent of the horizontal material by a inches and increase the extent of the vertical material by c inches.

If you want more control over your margins, then I highly recommend the LaTeX geometry package. The author of the geometry package is careful to ensure that all page settings are correctly assigned, leaving a straightforward interface to the user. As a simple example, add the following to your preamble:

\usepackage[hmargin=3cm,vmargin=3.5cm]{geometry}

This sets the left and right margins to be 3cm and the top and bottom margins to be 3.5cm. Full details are set out in section 5.3 of the geometry user manual.

• At 11:17 am,  Anonymous said…

Cheers mate

• At 4:48 pm,  Anonymous said…

Thanks for explaining this, and including the example of the geometry package.

• At 11:26 am,  Anonymous said…

• At 9:24 am,  Teja said…

That a very useful post. Thanks!

• At 5:53 am,  Dark Sun said…

Thumbs up from Dark Sun. Probably saved me hours.

• At 8:28 pm,  T. said…

Thanks, very useful post!

• At 12:19 am,  Srinivasa said…

Thanks for the post!
Question: What if you want to set different margins on the left and right sides? Thanks in advance!

• At 5:33 pm,  Andy Wilson said…

I had a lot of errors using all of the options individually, but the {geometry} options made everything really simple. Now it doensn't look like I'm trying to weasel out of page requirements;)

• At 4:58 am,  Anonymous said…

• At 11:21 am,  Anonymous said…

kudos MATE....that was really helpful :) :P :D

• At 3:19 pm,  steph said…

Really useful, if you want to set up margins in latex come here mate, you won't regret it.

Bravo, c'est du bon travail mon gars.

• At 10:38 pm,  Anonymous said…

• At 12:54 pm,  Anonymous said…

Thanks! This post gave me straight-forward and fast help on an otherwise complex topic. THANKS ALOT!

• At 10:44 pm,  Anonymous said…

What if you want to change the margin midstream in the text of the document? For example, how can you produce a wide margin in the textual part of a book for margin notes and graphical material, but then small margins at each chapter end where a multicolumn problem set could be displayed?

• At 9:51 pm,  Anonymous said…

well that got me out of a jam. thanks!

• At 4:01 pm,  Anonymous said…

Cheers, using the geometry package took me only 5 seconds.

• At 2:24 pm,  Anonymous said…

nice! this is way easier than what i've been doing. thanks for the tip.

• At 6:16 pm,  proteus said…

I also have been enormously helped by this useful information. Thank you for posting it --Donald

• At 12:39 am,  Sziri said…

• At 2:28 am,  Anonymous said…

SUPER HELPFUL! :D thanks! - roy, Philippines

• At 10:48 am,  Anonymous said…

Thank You

• At 10:14 pm,  Anonymous said…

Simple. Awesome.

• At 11:31 am,  Anonymous said…

thank you very much

• At 4:13 pm,  Dan Schroeder said…

Thank you! (From someone who's used plain TeX for 25 years and is utterly bewildered by LaTeX.)

• At 1:14 pm,  Anonymous said…

Thanks a lot for fullpage package!

• At 2:52 pm,  obeshankar said…

Thanks for helping me fix the margins on an old style document.

• At 10:49 am,  Anonymous said…

Thanks a lot & good work, it was very helpfull.

• At 1:56 pm,  shashindra said…

Thanks bro.

• At 9:59 am,  Anonymous said…

Thanks a lot!