Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
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 '12 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 '12 at 21:45
add comment

2 Answers

up vote 20 down vote accepted

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

share|improve this answer
    
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 '12 at 21:57
    
@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. –  Gonzalo Medina Mar 31 '12 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 '12 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. –  Gonzalo Medina Mar 31 '12 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} –  Harish Kumar Mar 31 '12 at 23:15
show 1 more comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.