我使用esami
MCQ 考试包,但它不允许在答案上对齐方程式,即在之间\Ans0 ... \eAns
。MWE 是
\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}
有zzz
一个空文件,而 MCQuestion 文件是
\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}
}
这个 MWE 运行得很好,但如果我添加符号&
来对齐方程式,就会出现错误
\Ans1 $\left\{\begin{aligned}5x+5y&=5000 \\ 5x+7y&=10\end{aligned}\right.$ \eAns
我该如何解决这个问题?
答案1
显然\bChoices
被 搞糊涂了&
。解决方案:大括号。
\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}
}
另一方面,对于这个应用程序,你可以从systeme
包中受益:如果你添加\usepackage{systeme}
到主文件,那么输入文件可以是
\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}
}
输出如下: