У меня большой нижний колонтитул, который нужно разместить на первой странице документа. Чтобы он вписался, я использовал пакет геометрии и увеличил нижнее поле.
Для манипуляций с верхним/нижним колонтитулом я использую 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
в \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: