我正在使用exam
模板,想知道如何计算问题总数和分数总数以便在封面上提供总数(在声明之前)?
这是我所拥有的。我确信它很容易,但在文档中找不到示例或正确的命令...
有人可以帮忙吗?
\documentclass[11pt]{exam}
\RequirePackage{amssymb, amsfonts, amsmath, latexsym, verbatim, xspace, setspace}
\RequirePackage{tikz, pgflibraryplotmarks}
\usepackage[margin=1in]{geometry}
\begin{document}
% some hearder and student info here, excluded for simplicity
% instructions
\textbf{Instructions:}
% how to count questions and marks to give the totals on a cover sheet?
This exam contains XXX questions, \numpages pages (including the cover) for the total of XXX marks.
\begin{questions}
% Basic question
\addpoints
\question[10] Differentiate $f(x)=x^2$ with respect to $x$.
% Basic question
\addpoints
\question[10] Differentiate $f(x)=x^3$ with respect to $x$.
\end{questions}
\end{document}
答案1
该exam
文件的第 4.7 节显示,有一些命令如下
\numquestions
,,\numpages
其中\numpoints
包括在文档末尾打印相关计数器的值。exam
使用totcounter
类似的方法。
注意:\numquestions questions
将打印2questions
,即使用\numquestions{} questions
(如 touhami 所建议的)或\numquestions\ questions
提供必要的明确空间。
\documentclass[11pt]{exam}
\RequirePackage{amssymb, amsfonts, amsmath, latexsym, verbatim, xspace, setspace}
\RequirePackage{tikz, pgflibraryplotmarks}
\usepackage[margin=1in]{geometry}
\begin{document}
% some hearder and student info here, excluded for simplicity
% instructions
\textbf{Instructions:}
% how to count questions and marks to give the totals on a cover sheet?
This exam contains \numquestions\ questions, \numpages\ pages (including the cover) for the total of \numpoints\ marks.
\begin{questions}
% Basic question
\addpoints
\question[10] Differentiate $f(x)=x^2$ with respect to $x$.
% Basic question
\addpoints
\question[10] Differentiate $f(x)=x^3$ with respect to $x$.
\end{questions}
\end{document}