![documentclass 考试的 legalpaper 选项不起作用--请帮忙](https://linux22.com/image/475607/documentclass%20%E8%80%83%E8%AF%95%E7%9A%84%20legalpaper%20%E9%80%89%E9%A1%B9%E4%B8%8D%E8%B5%B7%E4%BD%9C%E7%94%A8--%E8%AF%B7%E5%B8%AE%E5%BF%99.png)
我正在尝试创建一份美国法律试卷的多项选择考试。我在运行 MacOS 14.4.1 的 MacBook Air M2 上使用 TeXShop。我刚刚安装了 TeXLive 2024。以下是控制台日志的一部分:
LaTeX2e <2023-11-01> patch level 1
L3 programming layer <2024-02-20>
(/usr/local/texlive/2024/texmf-dist/tex/latex/exam/exam.cls
Document Class: exam 2023/07/09 Version 2.704 by Philip Hirschhorn
(/usr/local/texlive/2024/texmf-dist/tex/latex/base/ifthen.sty)
(/usr/local/texlive/2024/texmf-dist/tex/latex/base/article.cls
Document Class: article 2023/05/17 v1.4n Standard LaTeX document class
考试 documentclass 在使用默认信纸尺寸时可以按预期工作(documentclass 没有选项,但是当我添加选项时legalpaper
,它不再可靠地工作。
这是我的源文件(取自手册https://math.mit.edu/~psh/exam/examdoc.pdf):
\documentclass[answers,12pt]{exam}
\pagestyle{headandfoot}
\firstpageheadrule
\firstpagefootrule
\firstpageheader{Math 115}{Final Exam}{July 4, 1776}
\runningheader{Math 115}
{Page \thepage\ of \numpages}
{July 4, 1776}
\firstpagefooter{Math 115}{Final Exam}{Page \thepage\ of \numpages}
\runningfooter{Math 115}{Final Exam}{Page \thepage\ of \numpages}
\runningheadrule
\runningfootrule
\usepackage{times}
\begin{document}
EXAM
\begin{questions}
\question My question with multiple choices.
\begin{choices}
\choice The first choice.
\choice The second choice.
\choice The third choice.
\choice The fourth choice.
\CorrectChoice The fifth choice.
\end{choices}
\end{questions}
\end{document}
当我仅将legalpaper
选项添加到源文件时(来自 exam.cls 文档第 102 页):
\documentclass[legalpaper,answers,12pt]{exam}
\pagestyle{headandfoot}
\firstpageheadrule
\firstpagefootrule
\firstpageheader{Math 115}{Final Exam}{July 4, 1776}
\runningheader{Math 115}
{Page \thepage\ of \numpages}
{July 4, 1776}
\firstpagefooter{Math 115}{Final Exam}{Page \thepage\ of \numpages}
\runningfooter{Math 115}{Final Exam}{Page \thepage\ of \numpages}
\runningheadrule
\runningfootrule
\usepackage{times}
\begin{document}
EXAM
\begin{questions}
\question My question with multiple choices.
\begin{choices}
\choice The first choice.
\choice The second choice.
\choice The third choice.
\choice The fourth choice.
\CorrectChoice The fifth choice.
\end{choices}
\end{questions}
\end{document}
我得到以下输出(页眉上方有额外的空间并且没有页脚):
答案1
该类别没有设置 pdf 大小,所以如果您的网站默认设置是 A4,页面大小选项实际上不起作用,而且即使您的网站默认设置是美国信函,它们是否起作用也不清楚(我没有追踪它的设置)。
您可以向软件包维护人员报告此问题,但最简单的修复方法(对他们和您而言)是加载geometry
以修复问题。
如果你想使用几何选项调整其他东西,比如,\textheight
如果你愿意的话,可以稍微增加一点,
公用事业pdfinfo
报告
Page size: 612 x 792 pts (letter)
\documentclass[
letterpaper
,answers,12pt]{exam}
\usepackage{geometry}
\pagestyle{headandfoot}
\firstpageheadrule
\firstpagefootrule
\firstpageheader{Math 115}{Final Exam}{July 4, 1776}
\runningheader{Math 115}
{Page \thepage\ of \numpages}
{July 4, 1776}
\firstpagefooter{Math 115}{Final Exam}{Page \thepage\ of \numpages}
\runningfooter{Math 115}{Final Exam}{Page \thepage\ of \numpages}
\runningheadrule
\runningfootrule
\usepackage{times}
\begin{document}
EXAM
\begin{questions}
\question My question with multiple choices.
\begin{choices}
\choice The first choice.
\choice The second choice.
\choice The third choice.
\choice The fourth choice.
\CorrectChoice The fifth choice.
\end{choices}
\end{questions}
\end{document}