Vous devez déclarer ces paquets après automultiplechoice : fancyvrb, fancybox, pstricks, minted.
Pour utiliser pstricks, vous devez configurer AMC : → → → →
Issue du wiki.
Le paquet verbatim perturbe AMC et il devient impossible de l'utiliser dans les environnements question ou questionmult. Cet exemple ne compile pas.
\begin{question}{program}
What is the return value of the following R code?
\begin{verbatim}
sum(sapply(1:2^2,function(x) { x/2 }))
\end{verbatim}
\begin{choices}[o]
\wrongchoice{2.5}
\correctchoice{5}
\wrongchoice{NaN}
\end{choices}
\end{question}
Pour les textes court, encadrer celui-ci dans une commande particulière (ici, texte en italique).
\begin{question}{program}
What is the return value of the following R code?
\begin{center}
\texttt{sum(sapply(1:2\textasciicircum 2,function(x) \{ x/2 \}))}
\end{center}
\begin{choices}[o]
\wrongchoice{2.5}
\correctchoice{5}
\wrongchoice{NaN}
\end{choices}
\end{question}
https://www.ctan.org/pkg/verbatim.
Enregistrez le verbatim dans une commande avant \exemplaire
\SaveVerb{theRcode}'sum(sapply(1:2^2,function(x) { x/2 }))'
...
\begin{question}{program}
What is the return value of the following R code?
\begin{center}
\UseVerb{theRcode}
\end{center}
\begin{choices}[o]
\wrongchoice{2.5}
\correctchoice{5}
\wrongchoice{NaN}
\end{choices}
\end{question}
Pour des textes plus longs, enregistrez le verbatim dans un environnement myverbbox avant \exemplaire
\begin{myverbbox}{\Rcode}
sum(sapply(1:2^2,function(x) { x/2 }))
\end{myverbbox}
...
\begin{question}{program}
What is the return value of the following R code?
\begin{center}
\Rcode
\end{center}
\begin{choices}[o]
\wrongchoice{2.5}
\correctchoice{5}
\wrongchoice{NaN}
\end{choices}
\end{question}