我需要修复以下代码,使说明附加到第一页标题的末尾,以便将第一页上的考试主体向下推,而不是将标题向上推。
首页页眉
第二页页眉
\documentclass{exam}
\usepackage{graphicx,enumitem}
\usepackage[raster,skins,fitting]{tcolorbox}
\newcommand\headerBody{%
\begin{tcbitemize}[
raster valign = bottom,
valign = bottom,
raster columns = 2,
blankest,
raster before skip = 0ex, raster after skip = 1ex,
]
\tcboxfit[add to width = 2cm, halign = flush left,height=3em, valign=bottom]{%
First\\
Second\\
}
\tcbitem[add to width = -2cm, halign = flush right,] \includegraphics[height = 3em]{example-image}
\end{tcbitemize}}
\newcommand{\Instructions}{%
\begin{tcbraster}[
raster columns = 1,
valign = center,
raster before skip = 1ex, raster after skip = 1ex,
blankest,
height = 14em,
]
\tcboxfit[ halign = flush left , right = 1ex]{%
\textbf{Important Rules:}
\begin{itemize}[
label = \textbullet, leftmargin=*, labelsep = \fontdimen2\font, itemsep = 0.5\baselineskip, %nosep
topsep = 0.5\baselineskip
]
\item One.
\item Two.
\end{itemize}%
}
\end{tcbraster}
}
\newcommand\FirstHeader{%
\begin{minipage}[b][][t]{\textwidth}%
\begin{tcbraster}[
fit algorithm = hybrid,
raster equal height = rows,
raster halign = center, raster valign = center,
raster equal skip = 0mm, raster force size = false,
boxsep = 0pt, beforeafter skip = 0pt, leftright skip = 0pt,
nobeforeafter,
height = 2em,
]
\headerBody%
\vspace*{1ex}%
\hrule%
\Instructions
\end{tcbraster}%
\end{minipage}%
}
\newcommand\RunningHeader{%
\begin{minipage}[b][][t]{\textwidth}%
\begin{tcbraster}[
fit algorithm = hybrid,
raster equal height = rows,
raster halign = center, raster valign = center,
raster equal skip = 0mm, raster force size = false,
boxsep = 0pt, beforeafter skip = 0pt, leftright skip = 0pt,
nobeforeafter,
height = 2em,
]
\headerBody%
\vspace*{1ex}%
\hrule%
\end{tcbraster}%
\end{minipage}%
}
\pagestyle{headandfoot}
\firstpageheader{}{\FirstHeader}{}
\runningheader{}{\RunningHeader}{}
\firstpagefooter{}{first footer}{}
\runningfooter{}{running footer}{}
\usepackage[
a4paper,
includehead,
top = 0 mm,
headheight = 5em,
headsep = 0\baselineskip,
includefoot,
foot = 0 em,
bottom = 5.5 em,
showframe
]{geometry}
\begin{document}
text
\newpage
another text
\end{document}
答案1
首选:使用\firstpageheader{}{\RunningHeader}{}
和
\begin{document}
\Instructions
text
\newpage
another text
\end{document}
第二种选择(如果出于某种原因你需要/想要在标题中包含说明):使用相同的序言
\begin{document}
\newgeometry{includehead,
textheight=22.7 cm, % to be adjusted according the height of Instructions <<<
headheight = 50em,
headsep = 0\baselineskip,
includefoot,
foot = 0 em,
bottom = 5.5 em,
showframe}
text
\restoregeometry
\newpage
another text
\end{document}
结果类似,第一个选项是最简单的答案。(我添加了更多项目来测试第二个选项)