I want to prepare a book with many chapters (and sections), notes, exercises and linked solutions at the end of the book . I decided to adopt the example from on matching enumerated exercises with their answer. However, I want to display points per question part as shown here on the image. The exam package



 \newenvironment{Ex}[1]{\begin{trivlist}\item \textsc{#1} %


  \newenvironment{Solutionsublist}{\Writetofile{ans}{\string\begin{Solution}  {\theex}}}{\Writetofile{ans}{\string\end{Solution}}}`

 \section{Partial fractions}
 \section*{Exercises for Section \ref{sec:partial-fractions}}
 Who is the most famous mathematician of all time?
 Resolve each of the following proper rational expressions (some filler here)  into partial fractions.
 \item $\displaystyle{\frac{1}{(x - 1)(x - 2)}}$
    $\displaystyle{\frac{1}{x - 2} - \frac{1}{x - 1}}$
 \item $\displaystyle{\frac{5x + 4}{x^2 + x - 2}}$
    $\displaystyle{\frac{2}{x + 2} + \frac{3}{x - 1}}$
 \item $\displaystyle{\frac{7x - 1}{2x^2 - x - 1}}$
    $\displaystyle{\frac{3}{2x + 1} + \frac{2}{x - 1}}$
 \item $\displaystyle{\frac{25}{18x^3 - 9x^2 - 11x + 2}}$
    $\displaystyle{\frac{3}{3x + 2} - \frac{12}{6x - 1} + \frac{1}{x -
 \item $\displaystyle{\frac{x^2 + 15x - 4}{(x + 1)(x + 2)(x - 8)}}$
    $\displaystyle{\frac{2}{x - 8} + \frac{2}{x + 1} - \frac{3}{x +
 \item $\displaystyle{\frac{48}{(x^2 - 1)(x^2 - 9)}}$
    $\displaystyle{\frac{3}{x - 1} + \frac{3}{x + 1} - \frac{1}{x + 3}
    + \frac{1}{x - 3}}$

  \section*{Answers for Section \ref{sec:partial-fractions}}

  • At a certain point, it becomes easier to start from scratch than modify a package. There are a number of ways to set this up, including tabular and \makebox. You will need a counter for the (a) (b)... and another if you want to automatically compute the total. Feb 4, 2019 at 16:15

1 Answer 1


I am not familiar with the answer package but would propose a solution to add score points consisting of three parts:

  1. Use of a displayed math environment with \tag to display the appropriate score (additional benefit: remove need for endless \displaystyle calls).
  2. Redefine the \tag format to use brackets [] instead of parentheses () (possible with the mathtools package).
  3. Tweak from this answer to get the displayed math to appear on the same line as the item number.

Further adjustment may be required to suit your tastes. For starters, I would personally suggest adding at least leftmargin=* in the enumerate environment options in order to give your equations a bit more space (you may also wish to experiment with the fleqn option of the amsmath package).

Additional code for your preamble:

% Change tag form to brackets []
% Tweak to have displayed math appear on same line as \item. See https://tex.stackexchange.com/a/58145
  \ifx\relax#1\relax  \item \else \item[#1] \fi

Example use:

 \begin{multicols}{2} % Changed from 3
 % Optional - give equations a bit more room with leftmargin=*
    \frac{1}{(x - 1)(x - 2)}\tag{1}
    $\displaystyle{\frac{1}{x - 2} - \frac{1}{x - 1}}$

Note only 2 columns of equations sensibly fit (I've also left the solutions unchanged - you may want to change how you format these as well).

Example output:

enter image description here

This approach has the benefit that you can label each equation and retrieve the score at any time easily with \eqref.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .