36

I would like to know what are the margins (top, right,bottom and left; in meters) that are by default assigned for thebook class. Is there a command or a way to know them?

2
  • 2
    LaTeX model is different: it doesn't specify the four margins, but rather many more dimensions and deduces the bottom and right (outer) margins from them. With the layout package suggested by Gonzalo Medina you'll see those dimensions. The unit is "printer points": 72.27pt = 1in = 2.54cm
    – egreg
    Mar 31, 2012 at 21:34
  • 1
    The answer depends importantly on the text font size (10pt (default), 11pt, and 12pt) and on whether the output is set in single-column or two-column format. To find LaTeX's default values of the margins for each combination of these main options, either use the layout package (as is explained in @GonzaloMedina's answer) or open the files bk10.clo, bk11.clo, and bk12.clo files (.clo is short for "class option") manually and search for the relevant parameters. I recommend using the layout package...
    – Mico
    Mar 31, 2012 at 21:45

2 Answers 2

42

To produce an overview of the layout of the current document, you can use the \layout command from the layout package:

\documentclass{book}
\usepackage{layout}
\begin{document}
\layout
\end{document}

The ouput is a two page document showing this:

enter image description here

enter image description here

Another option would be to use the layouts package:

\documentclass{book}
\usepackage{layouts}

\newcommand\DocLength[1]{%
  The value for \texttt{#1} is \printinunitsof{mm}\prntlen{\csname#1\endcsname}\par}
\begin{document}

\DocLength{evensidemargin}
\DocLength{oddsidemargin}

\end{document}

enter image description here

Using the \pagevalues command you will obtain a table of the values of the current document’s page layout parameters; this, together with the showframe option for the geometry package, can be useful when designing a new page layout. A little example with some "extreme" values just for illustration:

\documentclass{article}
\usepackage[paperheight=12cm,paperwidth=18cm,includehead,includefoot,showframe]{geometry}
\usepackage{layouts}
\printinunitsof{cm}

\begin{document}
\pagevalues
\end{document}

enter image description here

7
  • But If I'm not satisfied of margins of my document how can I set them to myself using cm as unit of measure?
    – Mazzy
    Mar 31, 2012 at 21:57
  • 1
    @Mazzy: if you are talking about changing the predefined layout, then use the geometry package. For example, \usepackage[margin=3cm]{geometry} will give you 3cm margins. Mar 31, 2012 at 21:59
  • Suppose I would change the margin in this way: odd pages=margin top,bottom,left=3cm and right=3.5cm.even pages=margin top,right,bottom=3cm and left=3.5cm.
    – Mazzy
    Mar 31, 2012 at 22:01
  • @Mazzy Then you could use something like \usepackage[vmargin=3cm,rmargin=3.5cm,lmargin=3cm]{geometry} and probably you'll need some other options depending on whether the header/footer are to be included or not in the margins. Read the package documentation to learn all the options it offers. Mar 31, 2012 at 22:10
  • 4
    @Mazzy I think you are leaving that 3.5cm margin for binding. If so use \usepackage[bindingoffset=0.5cm,margin=3cm]{geometry}
    – user11232
    Mar 31, 2012 at 23:15
6

It depends on whether you want to include the header/footer and possibly even if you use twoside document. Perhaps the following minimal working example can be a start:

\documentclass{book}
\usepackage{layouts}% http://ctan.org/pkg/layouts
\begin{document}
\pagevalues
\end{document}

uses the layouts package to produce

enter image description here

All units are printed in points by default, and there are 0.0351459 points per cm. Note that LaTeX does not use metres as a valid length.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .