LaTeX 书籍类:页边距错误的双面文档

发布于 2024-08-27 02:48:20 字数 939 浏览 5 评论 0原文

我正在尝试用乳胶写我的论文...但无法直接布局:? 我正在使用以下文档类:

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

我的问题是:在奇数编号的页面上,右侧边距较大,左侧边距较小 - 应该是相反的......(对于绑定和东西) 我对此有点困惑——我是不是太愚蠢了,看到了显而易见的事情?奇数页码出现在装订文档的“右”页上,因此左侧需要有更大的装订线边距,反之亦然。正确的?

为什么 LaTeX 没有这样的行为?

以下是生成显示我的问题的小 Tex 文件的完整代码:

\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}

编辑: 我知道很多手动指定页边距的方法,例如

\setlength{\oddsidemargin}{53pt}  

或...

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

我只是想使用默认设置,但不明白为什么它们的行为不符合预期。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

情场扛把子 2024-09-03 02:48:21

对于回忆录类。

页边距是正确的。由于页边注释,奇数页右侧有更多空间。正如 @etaoin 指出的,您可以使用 \usepackage{layout} 来查看页面布局,并将 \layout 放入文档环境中。

我不使用边注,因此我的解决方案是将 \marginparwidth 减少到 0 或将其设置为一个较小的值。
您可以通过设置长度

\setlength{\marginparwidth}{0pt}

或使用文档 memman.pdf

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

然而,这对我来说并没有立即奏效,因为文本宽度保持不变。

我的最终解决方案是为边注设置所需的宽度,然后无论您获得什么宽度,都应该将其添加到文本宽度。在奇数页上,这种方法效果很好,因为文本会向右扩展。但是,在偶数页上,文本会向右增长,但可用空间却在左侧。
您还必须通过减少偶数边距来纠正此问题。
这是完整的解决方案:

% 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}

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}
深爱不及久伴 2024-09-03 02:48:20

我也有同样的问题。无论如何,这里是“简单”的解决方案(将其放在序言中):

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

干杯,
Chris

编辑:与之前的解决方案相反,提供的代码不会改变文档的样式:)

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 :)

姐不稀罕 2024-09-03 02:48:20

不,没错。奇数页应该有更大的边距。如果您购买双面书,则有 3 个页边距:左侧、中间、右侧。每个边距应大小相同。中间的一个是由每一侧的两个边距构建的。所以它必须更小。

如果要添加绑定偏移量,则需要使用包 Geometry:

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

或使用另一个类,例如 KOMA 类:

\documentclass[11pt,a4paper,twoside,openright,BCOR=1cm]{scrbook} 

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} 
叹沉浮 2024-09-03 02:48:20

额外的空间用于页边注释。一般来说,要查看布局的情况,可以将 \usepackage{layout} 放在序言中,然后将 \layout 粘贴到文档中以获得图表和几何设置列表。

就你的情况而言,正如我所说,所发生的是边注的额外空间。如果您不需要,请使用 \setlength{\marginparwidth}{0pt}

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}.

情深缘浅 2024-09-03 02:48:20

如果您有时间和意愿了解更多相关知识,以及有关页面布局和文档设计的许多其他知识,我相信学习 memoir 软件包将为您带来丰厚的投资回报。

特别是, memdesign.pdf 给出了基本原则彻底检查,以及 memman.pdf 是一个全面的(虽然很大!)参考。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文