Latex-仅更改几页的页边距

Latex-仅更改几页的页边距,latex,Latex,我有一个Latex文档,我只需要更改几页的页边距(我添加了很多图形的页面) 特别是,我想更改顶部边距(\voffset)。我试过做: \addtolength{\voffset}{-4cm} % Insert images here \addtolength{\voffset}{4cm} 但它不起作用。我看到了对geometry包的引用,但我没有发现如何在一堆页面上使用它,而不是在整个文档中使用它 有什么提示吗?我在beamer中使用过这个,但不是用于一般文档,但看起来这是原始提示的建议

我有一个Latex文档,我只需要更改几页的页边距(我添加了很多图形的页面)

特别是,我想更改顶部边距(
\voffset
)。我试过做:

\addtolength{\voffset}{-4cm}

% Insert images here

\addtolength{\voffset}{4cm}
但它不起作用。我看到了对geometry包的引用,但我没有发现如何在一堆页面上使用它,而不是在整个文档中使用它


有什么提示吗?

我在
beamer
中使用过这个,但不是用于一般文档,但看起来这是原始提示的建议

\newenvironment{changemargin}[2]{%
\begin{list}{}{%
\setlength{\topsep}{0pt}%
\setlength{\leftmargin}{#1}%
\setlength{\rightmargin}{#2}%
\setlength{\listparindent}{\parindent}%
\setlength{\itemindent}{\parindent}%
\setlength{\parsep}{\parskip}%
}%
\item[]}{\end{list}}
然后使用它

\begin{changemargin}{-1cm}{-1cm}
别忘了

\end{changemargin}
在这一页的末尾


我从TeX常见问题中得到了这一点。

对于图形,您可以使用此处描述的方法:

也就是说,这样做:

\begin{figure}[h]
\makebox[\textwidth]{%
        \includegraphics[width=1.5\linewidth]{bla.png}
    }
\end{figure}
请注意,如果图中有子图形,您可能希望在框内进入段落模式,如下所示:

\begin{figure}[h]
\makebox[\textwidth]{\parbox{1.5\textwidth}{ %
\centering
\subfigure[]{\includegraphics[width=0.7\textwidth]{a.png}}
\subfigure[]{\includegraphics[width=0.7\textwidth]{b.png}}
\end{figure}
允许图形在页面中居中,突出到两个页边距中,而不仅仅是右页边距。
这通常对图像起作用。请注意,使用此方法,图像的标题仍将位于由页面正常边距分隔的区域(这是一件好事)。

稍微修改一下以更改
\voffset

\newenvironment{changemargin}[1]{
  \begin{list}{}{
    \setlength{\voffset}{#1}
  }
  \item[]}{\end{list}}

然后把你的图形放在一个
\begin{changemargin}{-1cm}…\end{changemargin}
环境中。

使用“geometry”包,在你想要更改边距的地方写
\newgeometry{left=3cm,bottom=0.1cm}
。当你想重新设置页边距时,你可以在一些LaTeX参考中编写
\restoregeometry
查找
\enlargethispage

我在一次beamer演示中也遇到了同样的问题。对于我来说,使用columns环境工作:

\par\vfill\break % Break Last Page

\advance\vsize by 8cm % Advance page height
\advance\voffset by -4cm % Shift top margin
% Start big page
Some pictures
% End big page
\par\vfill\break % Break the page with different margins

\advance\vsize by -8cm % Return old margings and page height
\advance\voffset by 4cm % Return old margings and page height
\begin{frame}
  \begin{columns}
    \column{1.2\textwidth}
    \begin{figure}
      \subfigure{\includegraphics[width=.49\textwidth]{1.png}}
      \subfigure{\includegraphics[width=.49\textwidth]{2.png}}
    \end{figure}
   \end{columns}
\end{frame}

我找不到一个简单的方法来设置一页的页边空白

我的解决方案是将vspace与我想要的厘米数的空白空间结合使用:

 \vspace*{5cm}                                                             

我把这个命令放在我想要有+5cm边距的页面的开头。

我一直在努力寻找不同的解决方案,包括在页面顶部和底部的\vspace{-Xmm},以及处理警告和错误。最后我找到了这个答案:

您可以仅更改一个或多个页面的页边距,然后将其恢复为默认值:

\usepackage{geometry}
...
... 
...
\newgeometry{top=5mm, bottom=10mm}     % use whatever margins you want for left, right, top and bottom.
...
... %<The contents of enlarged page(s)>
...    
\restoregeometry     %so it does not affect the rest of the pages.
...
... 
...
\usepackage{geometry}
...
... 
...
\新几何体{top=5mm,bottom=10mm}%使用您想要的左、右、上和下边距。
...
... %
...    
\restoregeometry%,因此它不会影响其余页面。
...
... 
...
附言:

1-这还可以修复以下警告:

LaTeX警告:对于输入行上的…pt页,浮点太大

2-有关更详细的答案,请参阅


3-我刚刚发现这是对Kevin Chen答案的更详细阐述。

您能在您的答案中添加更多细节,包括解决方案吗?谢谢,这非常有效。我发现帮助文档是有帮助的,因为除了左边、右边、顶部和底部还有很多其他的边距选项:几何> <代码>命令的唯一问题是,如果在页面的中间使用,它们将文本冲洗到下一页,因为几何结构被定义为“页面”。.@Emadpres由于您想为某些页面定义新的页边距,
\newpage
\pagebreak
是您首先使用的必要且自然的命令。这比使用几何体对我更有效,因为在序言中包含几何体包已经破坏了我需要使用的样式的布局。非常感谢!图片文本作品见下面的回答不知道是谁在没有评论的情况下否决了这一点。这对我来说是个救命稻草!