Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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
1  
Perhaps the exam class could be an option for you. –  Gonzalo Medina Oct 27 '12 at 15:28
add comment

1 Answer

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).

screenshot

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

\documentclass[12pt,addpoints]{exam}

% can use geometry package to set page sizes
\usepackage[left=2.25cm,right=2.25cm,
        top=0.5cm,
        bottom=1.0cm,
        footskip=0.5cm
        ]{geometry}

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

\begin{document}

\pointsdroppedatright
\pointpoints{point}{points}

\extrawidth{0.5in}
\marginpointname{ \points}

% table of points
\gradetable

\bonusgradetable

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

        \vspace{\fill}
        \droppoints

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

        \vspace{\fill}
        \droppoints

    \end{parts}

    \newpage
    %+++++++++++++++++++++++++
    %   QUESTION
    %+++++++++++++++++++++++++
    \bonusquestion
    Find the following limits. 

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

        \vspace{\fill}
        \droppoints

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

        \vspace{\fill}
        \droppoints

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

        \vspace{\fill}
        \droppoints

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

        \vspace{\fill}
        \droppoints

    \end{parts}
\end{questions}

\end{document}
share|improve this answer
add comment

Your Answer

 
discard

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.