我有一个较大的页脚,需要放在文档的第一页。为了使其适合,我使用了几何包并增加了底部边距。
对于页眉/页脚操作,我使用fancyhdr
。如何在文本页面\newgeometry{bottom=2cm}
上再次使用,而不使用并猜测第二页从文本的哪里开始?2nd
\newpage
LaTex 可以在下一页执行命令吗?例如
\NextPageExecute{\newgeometry{bottom=3cm}}
就可以解决问题。以下是 MWE:
\documentclass{article}
\usepackage{xcolor}
\usepackage{lipsum}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=3cm]{geometry}
% Header customization, get the reference to the last page.
\usepackage{fancyhdr, lastpage}
\pagestyle{fancy}
% Header customization, get the reference to the last page.
\usepackage{fancyhdr, lastpage}
% Fancy pagestyle for the rest of the document.
\pagestyle{fancy}
\lhead{My form 11/17}
\rhead{Page \thepage of \pageref{LastPage}}
% Remove the horizontal line from the header.
\renewcommand{\headrulewidth}{0pt}
% Remove everything from the footline.
\cfoot{}
\definecolor{CUSTOM}{HTML}{00529e}
% Set the header and footer style.
\fancypagestyle{empty}{%
\fancyhf{}% Clear header/footer
\lhead{My form 11/17}
\rhead{Page \thepage of \pageref{LastPage}}
\lfoot{
Something something. \\
Memo text. \\
Some address information. \\
Telephone numbers. \\
}
\rfoot{
\textcolor{CUSTOM}{\Huge{HUGE TEXT}}
}
}
\begin{document}
\thispagestyle{empty}
\lipsum
\lipsum
\lipsum
\end{document}.
第一页如下所示:
第二页的页脚空间不必要地大:
答案1
该afterpage
包完全满足您的需求。鉴于您只希望3cm
在第一页和(例如)2cm
其他地方使用底部边距,我建议仅在第一页使用默认布局2cm
和使用\newgeometry
(后跟\restoregeometry\clearpage
in \afterpage
):
\documentclass{article}
\usepackage{xcolor}
\usepackage{lipsum}
\usepackage{afterpage}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}% 2cm bottom (usual)
% Header customization, get the reference to the last page.
\usepackage{fancyhdr, lastpage}
\pagestyle{fancy}
% Header customization, get the reference to the last page.
\usepackage{fancyhdr, lastpage}
% Fancy pagestyle for the rest of the document.
\pagestyle{fancy}
\lhead{My form 11/17}
\rhead{Page \thepage of \pageref{LastPage}}
% Remove the horizontal line from the header.
\renewcommand{\headrulewidth}{0pt}
% Remove everything from the footline.
\cfoot{}
\definecolor{CUSTOM}{HTML}{00529e}
% Set the header and footer style.
\fancypagestyle{empty}{%
\fancyhf{}% Clear header/footer
\lhead{My form 11/17}
\rhead{Page \thepage of \pageref{LastPage}}
\lfoot{
Something something. \\
Memo text. \\
Some address information. \\
Telephone numbers. \\
}
\rfoot{
\textcolor{CUSTOM}{\Huge{HUGE TEXT}}
}
}
\begin{document}
\newgeometry{left=2cm,right=2cm,top=2cm,bottom=3cm} % Change to 3cm bottom (temp)
\thispagestyle{empty}
\afterpage{\restoregeometry\clearpage}
% CONTENT HERE
\lipsum
\lipsum
\lipsum
\end{document}
第 1 页:
第2页: