
私は、米国リーガル ペーパーで多肢選択式試験を作成しようとしています。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
試験のドキュメントクラスは、デフォルトのレター用紙サイズで期待どおりに動作します (ドキュメントクラスにオプションはありませんが、オプションを追加すると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 の場合、ページ サイズのオプションは実際には機能しません。また、サイトのデフォルトが US レターであっても機能するかどうかは明らかではありません (設定をトレースしませんでした)。
パッケージのメンテナーに報告することもできますが、最も簡単な修正方法 (メンテナーにとってもあなたにとっても) は、ロードして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}