回忆录中不同页面样式的边距不同

回忆录中不同页面样式的边距不同

我正在尝试制作一份memoir仅在第一页带有信头的文档。我已pagestyle为信头创建了一个自定义,其上边距较大,以包含页眉;但即使我恢复到plain没有页眉的页面样式,这个较大的边距也会保留。我怎样才能仅在其中更改上边距pagestyle

%page style with different margins in memoir
\documentclass[oneside]{memoir}
\settypeblocksize{9in}{6.5in}{*}
\setlrmarginsandblock{1in}{1in}{*}
\setulmarginsandblock{1in}{1in}{*}
\checkandfixthelayout

\setheadfoot{5em}{2em}
\newlength{\marginPlusHead}
\setlength{\marginPlusHead}{1in}
\addtolength{\marginPlusHead}{\headsep}
\setulmarginsandblock{\marginPlusHead}{1in}{*}

\copypagestyle{letterhead}{plain}
\makeoddhead{letterhead}{}{{\Huge LETTERHEAD}}{}
\makeheadrule{letterhead}{\textwidth}{\normalrulethickness}
\checkandfixthelayout

\usepackage{lipsum}

\begin{document}

\pagestyle{plain}
\thispagestyle{letterhead}
\lipsum[1-15]

\end{document}

答案1

以下是如何使用 \raisebox 创建虚假页眉。如果将 \AddMargin 设置为 0pt,则第 1 页和第 2 页上的文本将对齐。

\documentclass[oneside]{memoir}
\settypeblocksize{9in}{6.5in}{*}
\setlrmarginsandblock{1in}{1in}{*}
\setulmarginsandblock{1in}{1in}{*}
\setheadfoot{5em}{2em}
\checkandfixthelayout

\usepackage{lipsum}

\newlength{\AddMargin}% additional margin for this page
\setlength{\AddMargin}{1in}

\begin{document}

\pagestyle{plain}
% places the rule \headsep above text area
\noindent\raisebox{\headsep}[\AddMargin][0pt]%
{\parbox[b]{\textwidth}{\hfil{\Huge HEADER}\newline%
\rule{\textwidth}{\normalrulethickness}}%
\hspace{-\textwidth}}% takes up no space
\lipsum[1-15]

\end{document}

相关内容