1

I have a number of multiple-choice questions. I want to produce an answer key (a small table with nx5 cells where the answer places are somehow highlighted).

My code (from another post ) is shown below:

\documentclass{article}
\usepackage{pgffor}
\usepackage{enumitem}

\newcommand\AnswersList{}
\newcommand\AddAnswer[1]{\edef\AnswersList{\AnswersList#1\endgraf}}

\newcommand*{\mc}[6]{%
    % code to display the multiple choice for #1...#5
    \AddAnswer{#6,}%
}%

\begin{document}

\mc{2}{3}{5}{7}{11}{3}
\mc{2}{3}{5}{7}{11}{5}


The list of answers are:

\begin{enumerate}[label=(\arabic*)]
\foreach \answer in \AnswersList {%
    \item \answer
}%
\end{enumerate}
\end{document}

The answer key may be something similar to the following image (in Persian or English).

image

closed as unclear what you're asking by Paul Gessler, Mensch, Claudio Fiandrino, Torbjørn T., egreg Feb 16 '15 at 8:14

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    What has your MWE to do with what you are trying to achieve? – karlkoeller Dec 20 '14 at 13:10

Browse other questions tagged or ask your own question.