LaTeX book class: Twosided document with wrong margins
I am trying to write my thesis i开发者_如何学Cn 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.
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 :)
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}
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}
.
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.
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}
精彩评论