TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have problem sets with multiple problems where each problem gives a different number of points. Some are bonus points, some are regular points. I'd like to show a table with each problem and the points, as well as a total (only non-bonus problems counted).

So far, I have just a simple table where I put in \ref{1}, \ref{2} and Total, and in the next line I have some / 10, /20 and /20 written down. In each problem, which is a \section, I have \label{1} to mark then.

This does work, but I have the feeling that this could be automated. I would like to write something like \points{20} and \points*{10} after the sections, or maybe \problem{problem title}{20}. Then the table in the beginning of the document would automatically list all the problems and sum up all the non-bonus points and print the total into the last column.

Is that feasible or more work than just creating that table by hand?

share|improve this question
Perhaps the exam class could be an option for you. – Gonzalo Medina Oct 27 '12 at 15:28

The exam documentclass is definitely worth considering for this task. It has a lot of features that help when constructing tests/exams/quizzes, which include

  • \question to specify a question, which takes an optional numerical argument to detail the number of points, e.g \question[10] says that the question is worth 10 points
  • \gradetable which keeps track of the questions and their point value
  • \part to break the question in parts, which also takes an optional numerical argument (same as \question).


I've put a complete MWE below- there are more features detailed in the the documentation.


% can use geometry package to set page sizes

% can set headers and footers, similar 
% to fancyhdr package
\cfoot{\footnotesize Page \thepage {} of \numpages}
\lfoot{\footnotesize TOTAL POINTS \numpoints\ }
\rfoot{\footnotesize Exam 1}



\marginpointname{ \points}

% table of points


    %   QUESTION
    Use the definition of the derivative to find $f'(x)$ for the following functions
        \part[4] $f(x) = 2x^2 + 3$


        \part[4] $\displaystyle f(x)=\frac{1}{{x+3}}$



    %   QUESTION
    Find the following limits. 

        \bonuspart[4] $\displaystyle \lim_{x\rightarrow 4}\frac{x^2-x-12}{x-4}$


        \part[4] $\displaystyle\lim_{h\rightarrow 0}\frac{\sqrt{4+h}-2}{h}$


        \part[4] $\displaystyle \lim_{x\rightarrow \infty}\frac{4x^3-x-2}{5x^3 + 4x +1}$


        \part[4] $\displaystyle \lim_{x\rightarrow \frac{\pi}{2}}\frac{\cos\left(x-\pi\right)}{\cos(x)\sin(x)}$



share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.