1

I use esami package for MCQ exams, but it doesn't allow align equations on the answers, i.e. between \Ans0 ... \eAns. The MWE is

\documentclass[spanish,twoside]{article}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{textcomp}

\usepackage[shuffle,zzz]{esami} % 
\def\numcompiti{1}%%% The number of the versions
\date{2014/07/22}%%% THE DATE IN THE FORMAT AAAA/M/D

\usepackage{amsmath}

\begin{document}
%\testversioni
%\pagestyle{esame}

\whiledo{\thevers<\numcompiti}{\stepvers%

\FPeval\seme{round((\thenomefile+(3*\thevers)):0)}

\randomi=\seme

\permuta

\begin{test}
\begin{questions}
\selectallproblems{MCQuestion}
\end{questions}
\end{test}

\closevers
}
\end{document}

with zzz an empty file, and MCQuestion file is

\newproblem{%
    \item Equivalent to $\left\{\begin{aligned}x+y&=1000 \\ 25x+35y&=50\end{aligned}\right.$
    \begin{answers}{2}
        \bChoices[random]
        \Ans1 $\left\{\begin{aligned}5x+5y=5000 \\ 5x+7y=10\end{aligned}\right.$ \eAns
        \Ans0 $\left\{\begin{aligned}x+y=1 \\ 25y+35y=150\end{aligned}\right.$ \eAns
        \eChoices
    \end{answers}
}

This MWE works perfectly, but if I add the & symbol in orden to align equations, I have an error

\Ans1 $\left\{\begin{aligned}5x+5y&=5000 \\ 5x+7y&=10\end{aligned}\right.$ \eAns

How can I fix this problem?

1 Answer 1

3

Apparently \bChoices is confused by &. Solution: braces.

\newproblem{%
    \item Equivalent to $\left\{\begin{aligned}x+y&=1000 \\ 25x+35y&=50\end{aligned}\right.$
    \begin{answers}{2}
        \bChoices[random]
        \Ans1 {$\left\{\begin{aligned}5x+5y&=5000 \\ 5x+7y&=10\end{aligned}\right.$} \eAns
        \Ans0 {$\left\{\begin{aligned}x+y&=1 \\ 25x+35y&=150\end{aligned}\right.$} \eAns
        \eChoices
    \end{answers}
}

On the other hand, for this application you can benefit from the systeme package: if you add \usepackage{systeme} to the main file, then the input file can be

\newproblem{%
    \item Equivalent to \systeme{x+y=1000,25x+35y=50}
    \begin{answers}{2}
        \bChoices[random]
        \Ans1 \systeme{5x+5y=5000,5x+7y=10} \eAns
        \Ans0 \systeme{x+y=1,25x+35y=150} \eAns
        \eChoices
    \end{answers}
}

with the following output:

enter image description here

1
  • Thanks! It works perfectly, and thank you again, I didn't know the 'systeme' package, and several months ago y was looking for a package exactly like this.
    – Gitano
    Oct 23, 2017 at 23:41

You must log in to answer this question.

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