> For the complete documentation index, see [llms.txt](https://overleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://overleaf-pro.ayaka.space/latex/ja/fen-ye-bie/09-typesetting-exams-in-latex.md).

# LaTeXで試験問題を組版する

## はじめに

LaTeXクラス `exam.cls` 試験問題の作成や設問の組版を簡単に行えます。すべての用紙サイズで1インチの余白を設定し、成績を記入・計算するための特別なコマンドを提供します。使用するには `exam` クラスを使うには、次の行を入れる必要があります

```latex
\documentclass{exam}
```

あなたの `.tex` ファイルの冒頭に置きます。これにより、このパッケージの試験関連コマンドが有効になり、ページ形式が採点用の余白を確保するように設定されます。

## 基本例

まずは～の基本的な動作例から始めましょう `exam` クラス。

```latex
\documentclass{exam}

\begin{document}

\begin{center}
\fbox{\fbox{\parbox{5.5in}{\centering
解答は指定された欄に記入してください。スペースが足りなくなったら
解答は、ページの裏面に続けてください。}}}
\end{center}

\vspace{5mm}
\makebox[0.75\textwidth]{Name and section:\enspace\hrulefill}

\vspace{5mm}
\makebox[0.75\textwidth]{Instructor’s name:\enspace\hrulefill}

\begin{questions}
\question \(x^n + y^n = z^n\) というのは、\(x,y,z\) と \(n\) が
正の整数なら真ですか？説明してください。

\question 関数のすべての非自明な零点の実部が
\(\zeta(z)\) が \(\frac{1}{2}\) であることを示せ

\question \[\int_{0}^{\infty} \frac{\sin(x)}{x}\] を計算せよ
\end{questions}
\end{document}
```

[Overleaf でこの例を開く](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Basic+exam+class+example\&snip=%5Cdocumentclass%7Bexam%7D%0A%0A%5Cbegin%7Bdocument%7D%0A%0A%5Cbegin%7Bcenter%7D%0A%5Cfbox%7B%5Cfbox%7B%5Cparbox%7B5.5in%7D%7B%5Ccentering%0AAnswer+the+questions+in+the+spaces+provided.+If+you+run+out+of+room%0Afor+an+answer%2C+continue+on+the+back+of+the+page.%7D%7D%7D%0A%5Cend%7Bcenter%7D%0A%0A%5Cvspace%7B5mm%7D%0A%5Cmakebox%5B0.75%5Ctextwidth%5D%7BName+and+section%3A%5Censpace%5Chrulefill%7D%0A%0A%5Cvspace%7B5mm%7D%0A%5Cmakebox%5B0.75%5Ctextwidth%5D%7BInstructor%E2%80%99s+name%3A%5Censpace%5Chrulefill%7D%0A%0A%5Cbegin%7Bquestions%7D%0A%5Cquestion+Is+it+true+that+%5C%28x%5En+%2B+y%5En+%3D+z%5En%5C%29+if+%5C%28x%2Cy%2Cz%5C%29+and+%5C%28n%5C%29+are%0Apositive+integers%3F.+Explain.%0A%0A%5Cquestion+Prove+that+the+real+part+of+all+non-trivial+zeros+of+the+function%0A%5C%28%5Czeta%28z%29%5C%29+is+%5C%28%5Cfrac%7B1%7D%7B2%7D%5C%29%0A%0A%5Cquestion+Compute+%5C%5B%5Cint_%7B0%7D%5E%7B%5Cinfty%7D+%5Cfrac%7B%5Csin%28x%29%7D%7Bx%7D%5C%5D%0A%5Cend%7Bquestions%7D%0A%5Cend%7Bdocument%7D)

![ExamEx1OLV2b.png](/files/dfc6dc170c7c066b5db67fcecb201eae35d84ded)

～の構文は `questions` 環境は、～のものと非常によく似ています `itemize` や `enumerate` 環境です。各設問はコマンド `\question` を前に付けて入力します。

この例の他のコマンドは、～専用ではありません `exam` クラス向けではありませんが、試験の簡単なヘッダーを作成するのに役立ちます。

## 新しい設問の作成

前の節では、設問の作成方法を示す基本例を紹介しました。設問はさらにカスタマイズでき、この節ではその方法を説明します。

### 間隔

学生に指定されたスペース内で解答させる必要がある場合、そのスペースは手動で設定することも、均等に配分することもできます。以下の例を参照してください：

```latex
\begin{questions}

\question \(x^n + y^n = z^n\) if \(x,y,z\) and \(n\) are positive integers?. Explain.
\vspace{\stretch{1}}

\question Prove that the real part of all non-trivial zeros of the function \(\zeta(z)\) is \(\frac{1}{2}\)
\vspace{\stretch{1}}

\question \[\int_{0}^{\infty} \frac{\sin(x)}{x}\] を計算せよ
\vspace{\stretch{1}}

\end{questions}
\clearpage
```

[この例をOverleafで開く](https://www.overleaf.com/docs?engine=\&snip_name=Providing+space+for+exam+questions\&snip=%5Cdocumentclass%7Bexam%7D%0A%0A%5Cbegin%7Bdocument%7D%0A%0A%5Cbegin%7Bcenter%7D%0A%5Cfbox%7B%5Cfbox%7B%5Cparbox%7B5.5in%7D%7B%5Ccentering%0AAnswer+the+questions+in+the+spaces+provided.+If+you+run+out+of+room%0Afor+an+answer%2C+continue+on+the+back+of+the+page.%7D%7D%7D%0A%5Cend%7Bcenter%7D%0A%0A%5Cvspace%7B5mm%7D%0A%5Cmakebox%5B0.75%5Ctextwidth%5D%7BName+and+section%3A%5Censpace%5Chrulefill%7D%0A%0A%5Cvspace%7B5mm%7D%0A%5Cmakebox%5B0.75%5Ctextwidth%5D%7BInstructor%E2%80%99s+name%3A%5Censpace%5Chrulefill%7D%0A%5Cbegin%7Bquestions%7D%0A%0A%5Cquestion+Is+it+true+that+%5C%28x%5En+%2B+y%5En+%3D+z%5En%5C%29+if+%5C%28x%2Cy%2Cz%5C%29+and+%5C%28n%5C%29+are+positive+integers%3F.+Explain.%0A%5Cvspace%7B%5Cstretch%7B1%7D%7D%0A%0A%5Cquestion+Prove+that+the+real+part+of+all+non-trivial+zeros+of+the+function+%5C%28%5Czeta%28z%29%5C%29+is+%5C%28%5Cfrac%7B1%7D%7B2%7D%5C%29%0A%5Cvspace%7B%5Cstretch%7B1%7D%7D%0A%0A%5Cquestion+Compute+%5C%5B%5Cint_%7B0%7D%5E%7B%5Cinfty%7D+%5Cfrac%7B%5Csin%28x%29%7D%7Bx%7D%5C%5D%0A%5Cvspace%7B%5Cstretch%7B1%7D%7D%0A%0A%5Cend%7Bquestions%7D%0A%5Cclearpage%0A%5Cend%7Bdocument%7D)

このコードの出力は下の画像に示されています。リンクを開くと、LaTeX文書のプリアンブルは自動的に追加されます：

![ExamEx2OLV2.png](/files/9f050d134dbb8e498a07a43e1120880ff266acf2)

この例ではコマンド `\vspace{\stretch{1}}` を各設問の後に置くと、利用可能なスペースが均等に配分されます。

コマンド `\clearpage` は改ページ位置を挿入し、新しいページで設問の入力を続けられるようにします。

各設問にスペースを手動で割り当てたい場合は、コマンド `\vspace{}` を使い、中括弧の中に必要なスペースの単位を書きます。たとえば、 `\vspace{1in}` は1インチの縦方向の空白を挿入します。についてのドキュメントを確認してください [LaTeXの長さ](/latex/ja/shu-shi-she-ding/01-lengths-in-latex.md) 使用可能な単位の一覧。

### 小問

設問がいくつかの部分に分かれていて、いくつかの小さなトピックに焦点を当てている場合は、環境 `parts`, `subparts`, `subsubparts` と対応するコマンド `\part`, `\subpart` や `\subsubpart`を使用できます。次の例を参照してください：

```latex
\begin{questions}
\question \(x,y,z\) と \(n\) が正の
整数。
\begin{parts}
\part 前の設問の記述が真となる \(n\) の値はどれですか？
\vspace{\stretch{1}}

\part \(n=2\) には特別な名前の定理があります。その名前は何ですか？
\vspace{\stretch{1}}

\part この定理に対して、ある著名な数学者が優雅な証明を持っていましたが
それを書き留める余白が十分にありませんでしたか？
\vspace{\stretch{1}}

\begin{subparts}
\subpart 実際にこの定理を証明したのは誰ですか？
\vspace{\stretch{1}}
\subpart この問題の解決には実際どれくらい時間がかかりましたか？
\vspace{\stretch{1}}
\end{subparts}

\end{parts}

\question 関数のすべての非自明な零点の実部が
\(\zeta(z)\) が \(\frac{1}{2}\) であることを示せ
...

\end{questions}
```

[この例をOverleafで開く](https://www.overleaf.com/docs?engine=\&snip_name=Multipart+exam+questions\&snip=%5Cdocumentclass%7Bexam%7D%0A%5Cbegin%7Bdocument%7D%0A%0A%5Cbegin%7Bcenter%7D%0A%5Cfbox%7B%5Cfbox%7B%5Cparbox%7B5.5in%7D%7B%5Ccentering%0AAnswer+the+questions+in+the+spaces+provided.+If+you+run+out+of+room%0Afor+an+answer%2C+continue+on+the+back+of+the+page.%7D%7D%7D%0A%5Cend%7Bcenter%7D%0A%0A%5Cvspace%7B5mm%7D%0A%5Cmakebox%5B0.75%5Ctextwidth%5D%7BName+and+section%3A%5Censpace%5Chrulefill%7D%0A%0A%5Cvspace%7B5mm%7D%0A%5Cmakebox%5B0.75%5Ctextwidth%5D%7BInstructor%E2%80%99s+name%3A%5Censpace%5Chrulefill%7D%0A%5Cbegin%7Bquestions%7D%0A%5Cquestion+Given+the+equation+%5C%28x%5En+%2B+y%5En+%3D+z%5En%5C%29+for+%5C%28x%2Cy%2Cz%5C%29+and+%5C%28n%5C%29+positive%0Aintegers.+%0A%5Cbegin%7Bparts%7D%0A%5Cpart+For+what+values+of+%5C%28n%5C%29+is+the+statement+in+the+previous+question+true%3F%0A%5Cvspace%7B%5Cstretch%7B1%7D%7D%0A%0A%5Cpart+For+%5C%28n%3D2%5C%29+there%27s+a+theorem+with+a+special+name.+What%27s+that+name%3F%0A%5Cvspace%7B%5Cstretch%7B1%7D%7D%0A%0A%5Cpart+What+famous+mathematician+had+an+elegant+proof+for+this+theorem+but%0Athere+was+not+enough+space+in+the+margin+to+write+it+down%3F%0A%5Cvspace%7B%5Cstretch%7B1%7D%7D%0A%0A%5Cbegin%7Bsubparts%7D%0A%5Csubpart+Who+actually+proved+the+theorem%3F%0A%5Cvspace%7B%5Cstretch%7B1%7D%7D%0A%5Csubpart+How+long+did+actually+take+to+solve+this+problem%3F%0A%5Cvspace%7B%5Cstretch%7B1%7D%7D%0A%5Cend%7Bsubparts%7D%0A%0A%5Cend%7Bparts%7D%0A%0A%5Cquestion+Prove+that+the+real+part+of+all+non-trivial+zeros+of+the+function+%0A%5C%28%5Czeta%28z%29%5C%29+is+%5C%28%5Cfrac%7B1%7D%7B2%7D%5C%29%0A...%0A%0A%5Cend%7Bquestions%7D%0A%5Cend%7Bdocument%7D)

このコードの出力は下の画像に示されています。リンクを開くと、LaTeX文書のプリアンブルは自動的に追加されます：

![ExamEx3OLV2.png](/files/351678cf9915b1e6bf7deef4fd591365c5c75d34)

環境 `parts` や `subparts` は設問のような入れ子のリストを提供します。設問と同様に、縦方向の間隔を手動で設定できます。

## 多肢選択問題

多肢選択問題を作成するための環境は4種類あります。

```latex
\begin{questions}
\question 次の有名な物理学者のうち、時間を発明したのは誰ですか？

\begin{oneparchoices}
 \choice スティーブン・ホーキング
 \choice アルベルト・アインシュタイン
 \choice エミー・ネーター
 \choice これは意味をなしません
\end{oneparchoices}

\question 次の有名な物理学者のうち、ブラウン運動に関する論文を発表したのは誰ですか？

\begin{checkboxes}
 \choice スティーブン・ホーキング
 \choice アルベルト・アインシュタイン
 \choice エミー・ネーター
 \choice わかりません
\end{checkboxes}
\end{questions}
```

[Overleaf でこの例を開く](https://www.overleaf.com/docs?engine=\&snip_name=Multiple+choice+exam+example\&snip=%5Cdocumentclass%7Bexam%7D%0A%5Cbegin%7Bdocument%7D%0A%5Cbegin%7Bquestions%7D%0A%5Cquestion+Which+of+these+famous+physicists+invented+time%3F%0A%0A%5Cbegin%7Boneparchoices%7D%0A+%5Cchoice+Stephen+Hawking+%0A+%5Cchoice+Albert+Einstein%0A+%5Cchoice+Emmy+Noether%0A+%5Cchoice+This+makes+no+sense%0A%5Cend%7Boneparchoices%7D%0A++++%0A%5Cquestion+Which+of+these+famous+physicists+published+a+paper+on+Brownian+Motion%3F%0A%0A%5Cbegin%7Bcheckboxes%7D%0A+%5Cchoice+Stephen+Hawking+%0A+%5Cchoice+Albert+Einstein%0A+%5Cchoice+Emmy+Noether%0A+%5Cchoice+I+don%27t+know%0A%5Cend%7Bcheckboxes%7D%0A%5Cend%7Bquestions%7D%0A%5Cend%7Bdocument%7D)

このコードの出力は下の画像に示されています。リンクを開くと、LaTeX文書のプリアンブルは自動的に追加されます：

![ExamMulti.png](/files/48fb31ce5786ee61672cab91aa069d4700ea1dd7)

この例では、多肢選択問題の選択肢を列挙するために2つの異なる環境を使っています。

* 環境 `oneparchoices` は選択肢に大文字の文字ラベルを付け、横並びに出力します。選択肢をリスト形式で出力したい場合は、環境 `choices` が適しています。
* 環境 `checkboxes` は各選択肢の前にチェックボックスを表示します。選択肢を横並びにしたい場合は、環境 `oneparcheckboxes` を代わりに使います。

## 採点

～のもう1つの重要な機能は `exam` 、試験の採点を簡単にするコマンドを提供していることです。

### 各設問の配点

各設問に `\question` または `\part` パラメータを追加すると、正しく解答したときに得られる点数を表示できます。設問や小問の後に角括弧で付ける追加パラメータは、その問題に割り当てられた点数を表します。点数の表示方法や表示位置は変更できます。 [リファレンスガイド](#reference-guide) 追加コマンドについては

```latex
\begin{questions}
\question \(x,y,z\) と \(n\) が正の
整数。
\begin{parts}
\part[10] 前の設問の記述が真となる \(n\) の値はどれですか？
\vspace{\stretch{1}}

\part[10] \(n=2\) には特別な名前の定理があります。その名前は何ですか？
\vspace{\stretch{1}}

\part[10] この定理に対して、ある著名な数学者が優雅な証明を持っていましたが
それを書き留める余白が十分にありませんでしたか？
\vspace{\stretch{1}}

\end{parts}

\question[20] \[\int_{0}^{\infty} \frac{\sin(x)}{x}\] を計算せよ

\vspace{\stretch{1}}
\end{questions}
```

[Overleaf でこの例を開く](https://www.overleaf.com/docs?engine=\&snip_name=Adding+points+to+exam+questions\&snip=%5Cdocumentclass%7Bexam%7D%0A%5Cbegin%7Bdocument%7D%0A%5Cbegin%7Bquestions%7D%0A%5Cquestion+Given+the+equation+%5C%28x%5En+%2B+y%5En+%3D+z%5En%5C%29+for+%5C%28x%2Cy%2Cz%5C%29+and+%5C%28n%5C%29+positive%0Aintegers.+%0A%5Cbegin%7Bparts%7D%0A%5Cpart%5B10%5D+For+what+values+of+%5C%28n%5C%29+is+the+statement+in+the+previous+question+true%3F%0A%5Cvspace%7B%5Cstretch%7B1%7D%7D%0A%0A%5Cpart%5B10%5D+For+%5C%28n%3D2%5C%29+there%27s+a+theorem+with+a+special+name.+What%27s+that+name%3F%0A%5Cvspace%7B%5Cstretch%7B1%7D%7D%0A%0A%5Cpart%5B10%5D+What+famous+mathematician+had+an+elegant+proof+for+this+theorem+but+there+was%0Anot+enough+space+in+the+margin+to+write+it+down%3F%0A%5Cvspace%7B%5Cstretch%7B1%7D%7D%0A%0A%5Cend%7Bparts%7D%0A%0A%5Cquestion%5B20%5D+Compute+%5C%5B%5Cint_%7B0%7D%5E%7B%5Cinfty%7D+%5Cfrac%7B%5Csin%28x%29%7D%7Bx%7D%5C%5D%0A%0A%5Cvspace%7B%5Cstretch%7B1%7D%7D%0A%5Cend%7Bquestions%7D%0A%5Cend%7Bdocument%7D)

このコードの出力は下の画像に示されています。リンクを開くと、LaTeX文書のプリアンブルは自動的に追加されます：

![ExamEx4OLV2b.png](/files/c51d2ecd38727884a3d4c009c143ce4a482aaefb)

### 点数と半点の数え方

小問の配点として半点を含めると便利な場合があります。それを行い、その後で設問全体の配点を表示できます。以下の例を参照してください：

```latex
\documentclass[addpoints]{exam}
\begin{document}
\begin{questions}
\question \(x,y,z\) と \(n\) が正の
整数。
\begin{parts}
\part[5] 前の設問の記述が真となる \(n\) の値はどれですか？
\vspace{\stretch{1}}

\part[2 \half] \(n=2\) には特別な名前の定理があります。その名前は何ですか？
\vspace{\stretch{1}}

\part[2 \half] この定理に対して、ある著名な数学者が優雅な証明を持っていましたが
それを書き留める余白が十分にありませんでしたか？
\vspace{\stretch{1}}

\end{parts}

\droptotalpoints

\question[20] \[\int_{0}^{\infty} \frac{\sin(x)}{x}\] を計算せよ
\end{questions}
\end{document}
```

[Overleaf でこの例を開く](https://www.overleaf.com/docs?engine=\&snip_name=exam+package+counting+points+and+half+points\&snip=%5Cdocumentclass%5Baddpoints%5D%7Bexam%7D%0A%5Cbegin%7Bdocument%7D%0A%5Cbegin%7Bquestions%7D%0A%5Cquestion+Given+the+equation+%5C%28x%5En+%2B+y%5En+%3D+z%5En%5C%29+for+%5C%28x%2Cy%2Cz%5C%29+and+%5C%28n%5C%29+positive%0Aintegers.+%0A%5Cbegin%7Bparts%7D%0A%5Cpart%5B5%5D+For+what+values+of+%5C%28n%5C%29+is+the+statement+in+the+previous+question+true%3F%0A%5Cvspace%7B%5Cstretch%7B1%7D%7D%0A%0A%5Cpart%5B2+%5Chalf%5D+For+%5C%28n%3D2%5C%29+there%27s+a+theorem+with+a+special+name.+What%27s+that+name%3F%0A%5Cvspace%7B%5Cstretch%7B1%7D%7D%0A%0A%5Cpart%5B2+%5Chalf%5D+What+famous+mathematician+had+an+elegant+proof+for+this+theorem+but+there+was%0Anot+enough+space+in+the+margin+to+write+it+down%3F%0A%5Cvspace%7B%5Cstretch%7B1%7D%7D%0A%0A%5Cend%7Bparts%7D%0A%0A%5Cdroptotalpoints%0A%0A%5Cquestion%5B20%5D+Compute+%5C%5B%5Cint_%7B0%7D%5E%7B%5Cinfty%7D+%5Cfrac%7B%5Csin%28x%29%7D%7Bx%7D%5C%5D%0A%5Cend%7Bquestions%7D%0A%5Cend%7Bdocument%7D)

このコードの出力は下の画像に示されています。リンクを開くと、LaTeX文書のプリアンブルは自動的に追加されます：

![ExamCountPointsOLV2.png](/files/7034ee2093b30036d5cc79ff6b5f780c9523f723)

コマンド `\half` は設問に半点を追加します。コマンド `\droptotalpoints` は最後の設問の合計点を表示します。このコマンドを機能させるには、オプション `[addpoints]` を文書クラス宣言に追加する必要があります。

### ボーナスポイント

ボーナス設問を追加することもできます。この追加点は後で [採点表](#grading-table)に表示されます。ボーナス設問やボーナス小問の追加は、通常の設問や小問を作成するのと同じくらい簡単です。

```latex
\begin{questions}

\question \(x,y,z\) と \(n\) が正の
整数。
\begin{parts}
\part[5] 前の設問の記述が真となる \(n\) の値はどれですか？
\vspace{\stretch{1}}

\part[2 \half] \(n=2\) には特別な名前の定理があります。その名前は何ですか？
\vspace{\stretch{1}}

\bonuspart[2 \half] この定理に対して、ある著名な数学者が優雅な証明を持っていましたが
それを書き留める余白が十分にありませんでしたか？
\vspace{\stretch{1}}

\end{parts}

\droptotalpoints

\question[20] \[\int_{0}^{\infty} \frac{\sin(x)}{x}\] を計算せよ

\vspace{\stretch{1}}

\bonusquestion[30] 関数のすべての非自明な零点の実部が
\(\zeta(z)\) が \(\frac{1}{2}\) であることを示せ
\vspace{\stretch{1}}

\end{questions}
```

[Overleaf でこの例を開く](https://www.overleaf.com/docs?engine=\&snip_name=exam+package+and+bonus+points\&snip=%5Cdocumentclass%5Baddpoints%5D%7Bexam%7D%0A%5Cbegin%7Bdocument%7D%0A%5Cbegin%7Bquestions%7D%0A%0A%5Cquestion+Given+the+equation+%5C%28x%5En+%2B+y%5En+%3D+z%5En%5C%29+for+%5C%28x%2Cy%2Cz%5C%29+and+%5C%28n%5C%29+positive%0Aintegers.+%0A%5Cbegin%7Bparts%7D%0A%5Cpart%5B5%5D+For+what+values+of+%5C%28n%5C%29+is+the+statement+in+the+previous+question+true%3F%0A%5Cvspace%7B%5Cstretch%7B1%7D%7D%0A%0A%5Cpart%5B2+%5Chalf%5D+For+%5C%28n%3D2%5C%29+there%27s+a+theorem+with+a+special+name.+What%27s+that+name%3F%0A%5Cvspace%7B%5Cstretch%7B1%7D%7D%0A%0A%5Cbonuspart%5B2+%5Chalf%5D+What+famous+mathematician+had+an+elegant+proof+for+this+theorem+but+there+was%0Anot+enough+space+in+the+margin+to+write+it+down%3F%0A%5Cvspace%7B%5Cstretch%7B1%7D%7D%0A%0A%5Cend%7Bparts%7D%0A%0A%5Cdroptotalpoints%0A%0A%5Cquestion%5B20%5D+Compute+%5C%5B%5Cint_%7B0%7D%5E%7B%5Cinfty%7D+%5Cfrac%7B%5Csin%28x%29%7D%7Bx%7D%5C%5D%0A%0A%5Cvspace%7B%5Cstretch%7B1%7D%7D%0A%0A%5Cbonusquestion%5B30%5D+Prove+that+the+real+part+of+all+non-trivial+zeros+of+the+function+%0A%5C%28%5Czeta%28z%29%5C%29+is+%5C%28%5Cfrac%7B1%7D%7B2%7D%5C%29%0A%5Cvspace%7B%5Cstretch%7B1%7D%7D%0A%0A%5Cend%7Bquestions%7D%0A%5Cend%7Bdocument%7D)

このコードの出力は下の画像に示されています。リンクを開くと、LaTeX文書のプリアンブルは自動的に追加されます：

![ExamEx6OLV2file.png](/files/949fe122466363ff6ce3f0f8f4349b71b885957d)

コマンド `\bonusquestion` や `\bonuspart` 表示する `(ボーナス)` を設問の配点の横に。

### 採点表

各設問の点数を示す表は、特別なコマンドで表示できます。

```latex
\begin{center}
\combinedgradetable[h][questions]
\end{center}
```

![ExamEx7.png](/files/d6c98f405525c231c01d192b7fb7fc8d533d6d3f)

採点表を出力するコマンドは3つあります。

**\gradetable**

通常の設問に対応する点数の表を出力します。ボーナス設問がある場合、それらは含まれません。

**\bonusgradetable**

ボーナス設問のみの点数の表を出力します

**\combinedgradetable**

通常設問とボーナス設問の両方を含む表を出力します。

これらのコマンドには、角括弧で囲まれた2つの追加パラメータがあります。

* 1つ目は `[h]` 横向きの表、または `[v]` 縦向きの表にします。
* 2つ目は、表の索引付け方法を設定します。 `[questions]` は設問ごとに点数を索引付けし、 `[pages]` はページ番号ごとに点数を一覧にします。

## Overleafの試験プロジェクト例

上の例を組み合わせて、作業の出発点として使える基本的なプロジェクトテンプレートを作成しました。次のリンクをクリック／選択して新しいプロジェクトを作成できます： [Overleafの `exam` プロジェクト例を開く](https://www.overleaf.com/project/new/template/20093?id=68314645\&templateName=Example+project+using+the+exam+class\&latexEngine=pdflatex\&texImage=texlive-full%3A2020.1\&mainFile=) .

### 他の言語

～では英語以外の言語はサポートされていません `exam` クラス。しかし、それらの既定語句をローカル言語に翻訳するのは簡単です。上のプロジェクトには、文書要素の一部をスペイン語に翻訳する方法を示すコメントアウトされたコード片が含まれています。

```latex
\usepackage[spanish]{babel}

\pointpoints{punto}{puntos}
\bonuspointpoints{punto extra}{puntos extra}

\totalformat{Pregunta \thequestion: \totalpoints puntos}

\chqword{Pregunta}
\chpgword{Página}
\chpword{Puntos}
\chbpword{Puntos extra}
\chsword{Puntos obtenidos}
\chtword{Total}

...
```

![ExamEx8.png](/files/8f522bf1412adeb0eeb5605ed8685a4cbc359936)

文書の残りの部分は、前の例で示したものとまったく同じです。ここで入力するコマンドは、～の既定語句を変更します `exam` クラス。

**\pointpoints{punto}{puntos}**

通常の設問と小問で、point と points を punto と puntos に変更します。

**\bonuspointpoints{punto extra}{puntos extra}**

ボーナス設問とボーナス小問で、bonus point と bonus points の代わりに punto extra と puntos extras を表示します。

**\totalformat{Pregunta \thequestion: \totalpoints puntos}**

\droptotalpoints によって出力されるテキストを変更します。例では Pregunta 1: 7 1/2 puntos と表示されます。

**\chqword{Pregunta}**

採点表の Question という語を Pregunta に変更します。残りのコマンドはその表の他の語を変更し、chpgword は Page、\chpword は Points、\chbpword は Bonus points、\chsword は Score、\chtword は Total に対応します。これらのコマンドは作成する表の種類によって異なる場合があります。他の表で必要なコマンドについてはリファレンスガイドを参照してください。

## リファレンスガイド

### 設問の配点表示の配置と書式設定

これらのコマンドはプリアンブルに書いて文書全体の書式を変更することも、設問の直前に書いてその設問から次の書式変更コマンド、または文書末尾までの書式を変更することもできます。

* `\poinstinmargin` （または `\pointsinleftmargin`) を付けると、配点が左余白に表示されます。
* `\pointsinrightmargin` を付けると、配点が右余白に表示されます。
* `\nopointsinmargin` （または `\nopointsinrightmargin`) を付けると、既定の状態に戻ります。
* `\bracketedpoints` は配点の周りに丸括弧ではなく角括弧を使います。
* `\boxedpoints` は配点の周りに枠を付けます。

以下は～を使った例です `\pointsinmargin` や `\pointsinrightmargin`:

```latex
ここでは \verb|\pointsinmargin| を使います
\begin{questions}
\pointsinmargin
\question \(x,y,z\) と \(n\) が正の
整数。
\begin{parts}
\part[5] 前の設問の記述が真となる \(n\) の値はどれですか？
\vspace{40pt}

\part[2 \half] \(n=2\) には特別な名前の定理があります。その名前は何ですか？
\vspace{40pt}

\part[2 \half] この定理に対して、ある著名な数学者が優雅な証明を持っていましたが
それを書き留める余白が十分にありませんでしたか？

\vspace{40pt}
\end{parts}

次に \verb|\pointsinrightmargin| を使います

\pointsinrightmargin
\question \(x,y,z\) と \(n\) が正の
整数。
\begin{parts}
\part[5] 前の設問の記述が真となる \(n\) の値はどれですか？
\vspace{40pt}

\part[2 \half] \(n=2\) には特別な名前の定理があります。その名前は何ですか？
\vspace{40pt}

\part[2 \half] この定理に対して、ある著名な数学者が優雅な証明を持っていましたが
それを書き留める余白が十分にありませんでしたか？
整数。
\end{parts}
\end{questions}
```

[Overleaf でこの例を開く](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=exam+class+with+point+in+margins\&snip=%5Cdocumentclass%5Baddpoints%5D%7Bexam%7D%0A%5Cusepackage%5Ba4paper%2C+total%3D%7B6in%2C+8in%7D%5D%7Bgeometry%7D%0A%5Cbegin%7Bdocument%7D%0AHere+we%27ll+use+%5Cverb%7C%5Cpointsinmargin%7C%0A%5Cbegin%7Bquestions%7D%0A%5Cpointsinmargin%0A%5Cquestion+Given+the+equation+%5C%28x%5En+%2B+y%5En+%3D+z%5En%5C%29+for+%5C%28x%2Cy%2Cz%5C%29+and+%5C%28n%5C%29+positive%0Aintegers.+%0A%5Cbegin%7Bparts%7D%0A%5Cpart%5B5%5D+For+what+values+of+%5C%28n%5C%29+is+the+statement+in+the+previous+question+true%3F%0A%5Cvspace%7B40pt%7D%0A%0A%5Cpart%5B2+%5Chalf%5D+For+%5C%28n%3D2%5C%29+there%27s+a+theorem+with+a+special+name.+What%27s+that+name%3F%0A%5Cvspace%7B40pt%7D%0A%0A%5Cpart%5B2+%5Chalf%5D+What+famous+mathematician+had+an+elegant+proof+for+this+theorem+but+there+was%0Anot+enough+space+in+the+margin+to+write+it+down%3F%0A%0A%5Cvspace%7B40pt%7D%0A%5Cend%7Bparts%7D%0A%0ANow+we%27ll+use+%5Cverb%7C%5Cpointsinrightmargin%7C%0A%0A%5Cpointsinrightmargin%0A%5Cquestion+Given+the+equation+%5C%28x%5En+%2B+y%5En+%3D+z%5En%5C%29+for+%5C%28x%2Cy%2Cz%5C%29+and+%5C%28n%5C%29+positive%0Aintegers.+%0A%5Cbegin%7Bparts%7D%0A%5Cpart%5B5%5D+For+what+values+of+%5C%28n%5C%29+is+the+statement+in+the+previous+question+true%3F%0A%5Cvspace%7B40pt%7D%0A%0A%5Cpart%5B2+%5Chalf%5D+For+%5C%28n%3D2%5C%29+there%27s+a+theorem+with+a+special+name.+What%27s+that+name%3F%0A%5Cvspace%7B40pt%7D%0A%0A%5Cpart%5B2+%5Chalf%5D+What+famous+mathematician+had+an+elegant+proof+for+this+theorem+but+there+was%0Anot+enough+space+in+the+margin+to+write+it+down%3F%0Aintegers.+%0A%5Cend%7Bparts%7D%0A%5Cend%7Bquestions%7D%0A%5Cend%7Bdocument%7D)

次の画像は上のコードの出力を示しています：

![Examclassmargins.png](/files/900aa55ff885af03e90ebf152c011df526ce4ff8)

### 採点表の既定名の変更

コマンドは、表の形式と表示される情報によって異なります。 **h** や **v** は、それぞれのコマンド内で横向きまたは縦向きを意味します。コマンドの前に **b** が付くとボーナス表の書式を変更し、コマンドの前に **c** が付くと、複合表に対して機能します。たとえば、縦向きのボーナス表で "Score" を "Points Awarded" に変更するには、 `\bvsword{Points Awarded}`.

以下に既定値の表を示します。

|               | **横向き**                                                                                                                                                                                                              | **縦向き**                                                                                                                                                                                                          |
| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **採点表**       | <p><code>\hqword{Question:}</code><br><code>\hpgword{Page:}</code><br><code>\hpword{Points:}</code><br><code>\hsword{Score:}</code><br><code>\htword{Total}</code></p>                                               | <p><code>\vqword{Question}</code><br><code>\vpgword{Page}</code><br><code>\vpword{Points}</code><br><code>\vsword{Score}</code><br><code>\vtword{Total:}</code></p>                                              |
| **ボーナスポイント表** | <p><code>\bhqword{Question:}</code><br><code>\bhpgword{Page:}</code><br><code>\bhpword{Bonus Points:}</code><br><code>\bhsword{Score:}</code><br><code>\bhtword{Total}</code></p>                                    | <p><code>\bvqword{Question}</code><br><code>\bvpgword{Page}</code><br><code>\bvpword{Bonus Points}</code><br><code>\bvsword{Score}</code><br><code>\bvtword{Total:}</code></p>                                   |
| **複合表**       | <p><code>\chqword{Question:}</code><br><code>\chpgword{Page:}</code><br><code>\chpword{Points:}</code><br><code>\chbpword{Bonus Points:}</code><br><code>\chsword{Score:}</code><br><code>\chtword{Total}</code></p> | <p><code>\cvqword{Question}</code><br><code>\cvpgword{Page}</code><br><code>\cvpword{Points}</code><br><code>\cvbpword{Bonus Points}</code><br><code>\cvsword{Score}</code><br><code>\cvtword{Total:}</code></p> |

## さらに読む

詳しくは以下を参照してください：

* [LaTeXで文書を作成する](/latex/ja/latexno/01-learn-latex-in-30-minutes.md)
* [太字、斜体、下線](/latex/ja/latexno/03-bold-italics-and-underlining.md)
* [リスト](/latex/ja/latexno/04-lists.md)
* [数式](/latex/ja/shu-xue/01-mathematical-expressions.md)
* [下付き文字と上付き文字](/latex/ja/shu-xue/02-subscripts-and-superscripts.md)
* [角括弧と丸括弧](/latex/ja/shu-xue/03-brackets-and-parentheses.md)
* [数式の配置](/latex/ja/shu-xue/06-aligning-equations-with-amsmath.md)
* [ギリシャ文字と数式記号の一覧](/latex/ja/shu-xue/11-list-of-greek-letters-and-math-symbols.md)
* [画像の挿入](/latex/ja/sononotopikku/27-inserting-images.md)
* [画像と表の配置](/latex/ja/to/02-positioning-images-and-tables.md)
* [フォントサイズ、ファミリー、スタイル](/latex/ja/fonto/01-font-sizes-families-and-styles.md)
* [フォントの書体](/latex/ja/fonto/02-font-typefaces.md)
* [この **exam** クラスのドキュメント](https://mirror.ox.ac.uk/sites/ctan.org/macros/latex/contrib/exam/examdoc.pdf).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://overleaf-pro.ayaka.space/latex/ja/fen-ye-bie/09-typesetting-exams-in-latex.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
