LaTeX book class: Twosided document with wrong margins
Asked Answered
A

5

46

I am trying to write my thesis in latex... Cannot get the layout straight though :? I'm using the following document class:

\documentclass[11pt,a4paper,twoside,openright]{book}

My problem is: on the odd numbered pages there is a big margin right, and a small margin left - it should be the other way round... (for binding & stuff) I am a little puzzled by this -- am I just to stupid to see the obvious? The odd page numbers appear on the 'right' page of a bound document, so there needs to be a larger gutter margin on the left for binding -- and vice versa. Right?

Why does LaTeX not behave like this?

Here is the full code to produce a small Tex file that shows my problem:

\documentclass[11pt,a4paper,twoside,openright]{book}
\begin{document}
\chapter{blah}
Lorem ipsum ius et accumsan tractatos, aliquip deterruisset cu usu. Ea soleat eirmod nostrud eum, est ceteros similique ad, at mea tempor petentium. At decore neglegentur quo, ea ius doming dictas facilis, duo ut porro nostrum suavitate.
\end{document}

Edit: I know about a lot of ways to manually specify the page margins, like

\setlength{\oddsidemargin}{53pt}  

or ...

\usepackage[lmargin=1cm,rmargin=2.5cm,tmargin=2.5cm,bmargin=2.5cm]{geometry}

I just wanted to use the default settings and don't understand why they do not behave as expected.

Alembic answered 2/4, 2010 at 8:35 Comment(0)
F
18

The extra space is for the margin notes. In general, to see what's going on with your layout, you can put \usepackage{layout} in your preamble, and then stick \layout in your document to get a diagram and listing of geometry settings.

In your case, as I say, what's going in is the extra space for margin notes. If you don't want it, use \setlength{\marginparwidth}{0pt}.

Froghopper answered 2/4, 2010 at 8:52 Comment(3)
That actually explains a lot... I still find it a bit strange though -- the books I have on my table right now all have a bigger margin near the binding. Anyway, thx for helping. I guess I'll have to work around the margin thing manually...Alembic
i would downvote this as the reason in the book style is actually not the notes, but rather that all three margins in a book (left, middle, right) should be the same size. However, i would upvote it for mentioning layout. Instead of a vote you now get this comment ;)Wanettawanfried
@Alembic Check out the memoir user manual www.tex.ac.uk/ctan/macros/latex/contrib/memoir/memman.pdf. In Chapter 3 he shows several layouts worth thinking about.Paraboloid
S
30

I had the same problem. Anyhow, here the "simple" solution (put it in your preamble):

\let\tmp\oddsidemargin
\let\oddsidemargin\evensidemargin
\let\evensidemargin\tmp
\reversemarginpar

Cheers, Chris

Edit: Contrary to the previous solutions, the provided code does not change the style of the document :)

Sterrett answered 27/8, 2012 at 13:2 Comment(2)
Damn this is ugly, but totally made my day when my MikTeX was acting up and I had to complete the document on time. :)Gemperle
I love you, I spent a whole day on the problem, you just saved my life :).Farrell
C
27

No, that's right. The odd pages should have a bigger margin. If you take a twosided book, you have 3 margings: On the left, in the middle, on the right. Every margin should be the same size. The one in the middle is build by two margins from each side. So it has to be smaller.

If you want to add a bindingoffset, you need to use the package geometry:

\usepackage{geometry}
\geometry{bindingoffset=1cm}

or use another class, like the KOMA-classes:

\documentclass[11pt,a4paper,twoside,openright,BCOR=1cm]{scrbook} 
Connotation answered 2/4, 2010 at 8:50 Comment(1)
BCOR stands for "Binding Correction". See ctex.org/documents/packages/nonstd/koma-script.pdf for more details.Braxy
F
18

The extra space is for the margin notes. In general, to see what's going on with your layout, you can put \usepackage{layout} in your preamble, and then stick \layout in your document to get a diagram and listing of geometry settings.

In your case, as I say, what's going in is the extra space for margin notes. If you don't want it, use \setlength{\marginparwidth}{0pt}.

Froghopper answered 2/4, 2010 at 8:52 Comment(3)
That actually explains a lot... I still find it a bit strange though -- the books I have on my table right now all have a bigger margin near the binding. Anyway, thx for helping. I guess I'll have to work around the margin thing manually...Alembic
i would downvote this as the reason in the book style is actually not the notes, but rather that all three margins in a book (left, middle, right) should be the same size. However, i would upvote it for mentioning layout. Instead of a vote you now get this comment ;)Wanettawanfried
@Alembic Check out the memoir user manual www.tex.ac.uk/ctan/macros/latex/contrib/memoir/memman.pdf. In Chapter 3 he shows several layouts worth thinking about.Paraboloid
M
7

If you have the time and inclination to learn more about this, and many other things about page layout and document design in general, I believe that studying the memoir package will give you an excellent return on your investment.

In particular, memdesign.pdf gives the underlying principles a thorough going-over, and memman.pdf is a comprehensive (though large!) reference.

Markland answered 2/4, 2010 at 11:1 Comment(1)
Nice doc you linked there, like it! will certainly look into this at some point...Alembic
G
0

In the case of the memoir class.

The margins are correct. There is more space to the right of the odd pages because of margin notes. As @etaoin pointed out, you can see the page layout with \usepackage{layout} and putting \layout within the document environment.

I don't use margin notes, therefore my solution is to reduce the \marginparwidth to 0 or set it to a small value. You can do that directly by setting the length

\setlength{\marginparwidth}{0pt}

or using the command \setmarginnotes described in the documentation memman.pdf.

\setmarginnotes{0pt}{0pt}{0pt}

However, that didn't worked out for me immediately because the text width remained the same.

My final solution is to set a desired width to the margin note, then whatever width you gained you should add it to the text width. On the odd pages this works fine because the text expands to the right. However, on the even pages the text grows to the right but your free space is to the left. You have to correct this by decreasing the even side margin as well. Here's the complete solution:

% the new margin note width will be a fraction of the old one
\newlength{\notewidth}
\setlength{\notewidth}{0.2\marginparwidth}

% deltanotewidth is the space that we gain
\newlength{\deltanotewidth}
\setlength{\deltanotewidth}{\marginparwidth}
\addtolength{\deltanotewidth}{-\notewidth}

% update the note width
\setlength{\marginparwidth}{\notewidth}

% the text width grows
\addtolength{\textwidth}{\deltanotewidth}
% the even side margin reduces to fit the bigger text
\addtolength{\evensidemargin}{-\deltanotewidth}
Golightly answered 11/11, 2022 at 15:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.