Latex - 仅更改几页的页边距
我有一个 Latex 文档,我只需要更改几页(我添加大量图形的页面)的页边距。
特别是,我想更改上边距 (\voffset
)。我尝试过这样做:
\addtolength{\voffset}{-4cm}
% Insert images here
\addtolength{\voffset}{4cm}
但没有成功。我已经看到了对几何包的引用,但我还没有找到如何将它用于一堆页面,而不是整个文档。
有什么提示吗?
I have a Latex document where I need to change the margins of only a few pages (the pages where I'm adding a lot of graphics).
In particular, I'd like to change the top margins (\voffset
). I've tried doing:
\addtolength{\voffset}{-4cm}
% Insert images here
\addtolength{\voffset}{4cm}
but it didn't work. I've seen references to the geometry package, but I haven't found how to use it for a bunch of pages, and not for the whole document.
Any hints?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(10)
使用“geometry”包并在要更改边距的位置写入
\newgeometry{left=3cm,bottom=0.1cm}
。当你想重置边距时,你可以写\restoregeometry
。Use the "geometry" package and write
\newgeometry{left=3cm,bottom=0.1cm}
where you want to change your margins. When you want to reset your margins, you write\restoregeometry
.我在
beamer
中使用过它,但不适用于一般文档,但看起来这就是原始提示所建议的然后使用它,
不要忘记在
页面末尾
我从中得到的 TeX FAQ 中的“即时”更改边距。
I've used this in
beamer
, but not for general documents, but it looks like that's what the original hint suggestsThen to use it
don't forget to
at the end of the page
I got this from Changing margins “on the fly” in the TeX FAQ.
我在不同的解决方案上遇到了很多困难,包括页面顶部和底部的 \vspace{-Xmm} 以及处理警告和错误。最后我找到了这个答案:
您可以更改一页或多页的边距,然后将其恢复为默认值:
PS:
1-这还可以修复以下警告:
2- 有关更详细的答案,请参阅 此。
3-我刚刚发现这是对Kevin Chen的答案的更多阐述。
I was struggling a lot with different solutions including \vspace{-Xmm} on the top and bottom of the page and dealing with warnings and errors. Finally I found this answer:
You can change the margins of just one or more pages and then restore it to its default:
PS:
1- This can also fix the following warning:
2- For more detailed answer look at this.
3- I just found that this is more elaboration on Kevin Chen's answer.
对于数字,您可以使用此处描述的方法:
http://texblog.net/latex-archive/layout/centering-figure -表/
即,执行如下操作:
请注意,如果图中有子图,您可能希望在框中进入段落模式,如下所示:
为了允许图在页面中居中,而不是突出到两个边距中不仅仅是右边距。
这通常可以解决图像问题。请注意,使用此方法,图像的标题仍将由页面的正常边距分隔(这是一件好事)。
For figures you can use the method described here :
http://texblog.net/latex-archive/layout/centering-figure-table/
namely, do something like this:
Notice that if you have subfigures in the figure, you'll probably want to enter into paragraph mode inside the box, like so:
For allowing the figure to be centered in the page, protruding into both margins rather than only the right margin.
This usually does the trick for images. Notice that with this method, the caption of the image will still be in the delimited by the normal margins of the page (which is a good thing).
稍微修改此以更改
\ voffset
对我有用:然后将您的图形放入
\begin{changemargin}{-1cm}...\end{changemargin}
环境中。A slight modification of this to change the
\voffset
works for me:And then put your figures in a
\begin{changemargin}{-1cm}...\end{changemargin}
environment.我找不到设置单页边距的简单方法。
我的解决方案是使用 vspace 和我想要的空白空间的厘米数:
我将此命令放在我想要有 +5cm 边距的页面的开头。
I could not find a easy way to set the margin for a single page.
My solution was to use vspace with the number of centimeters of empty space I wanted:
I put this command at the beginning of the pages that I wanted to have +5cm of margin.
在一些 LaTeX 参考中查找
\enlargethispage
。Look up
\enlargethispage
in some LaTeX reference.这对我有用:
This worked for me:
我在投影仪演示中遇到了同样的问题。对我来说,使用 columns 环境工作:
I had the same problem in a beamer presentation. For me worked using the columns environment: