我目前正在使用 latex 考试类制作试卷。我希望页面框架在两个边距上都带有“写在页边距中的答案将不会被标记”字样,并且页眉或页脚位于框架之外,如下图所示。
这是我的一些代码。非常感谢您的帮助。
\documentclass[a4paper,addpoints]{exam}
\usepackage{lipsum}
\pagestyle{headandfoot}
\header{Prepared by Dexter}{}{Page \thepage}
\begin{document}
\begin{questions}
\question[3] Thanks for your help.
\question[2] \lipsum
\end{questions}
\end{document}
答案1
像这样吗?
代码:
\documentclass[a4paper,addpoints]{exam}
\usepackage{tikzpagenodes}
\usetikzlibrary{calc}
\usepackage{eso-pic}
\AddToShipoutPictureBG{%
\begin{tikzpicture}[overlay,remember picture]
\draw[line width=1.5pt]
($ (current page text area.north west) + (-3mm,3mm) $)
rectangle
($ (current page text area.south east) + (3mm,-3mm) $);
\node[rotate=90]
at ([xshift=15mm] current page.west)
{Answer written in the margins will not be marked};
\node[rotate=-90]
at ([xshift=-15mm] current page.east)
{Answer written in the margins will not be marked};
\end{tikzpicture}
}
\usepackage{lipsum}
\pagestyle{headandfoot}
\header{Prepared by Dexter}{}{Page \thepage}
\footer{Answer written in the margins will not be marked}{}{}
\begin{document}
\begin{questions}
\question[3] Thanks for your help.
\question[2] \lipsum
\end{questions}
\end{document}