如果我尝试在 \mcanswers 环境中使用 \includegraphics 并使用 \answernum,则会收到“!\Gin@ii 的参数有一个额外的 }。”
\documentclass[a4paper]{article}
\usepackage[output=exam
,numberofversions=2
,version=1
,seed=1
,randomizequestions=false
,randomizeanswers=true
,writeRfile=true
]{mcexam}
\usepackage{array}
\usepackage{graphicx}
\begin{document}
\begin{mcquestions}
\question Which symbol means flammable?
\begin{mcanswers}
\begin{tabular}{m{.5cm}m{3cm}}
& Col2 \\
& Col2 \\
\answernum{1} & \answer{1} \includegraphics[scale=.3]{example-image.png} \\
\answernum{2} & \answer[correct]{2} \includegraphics[scale=.3]{example-image.png}\\
\end{tabular}
\end{mcanswers}
\end{mcquestions}
\end{document}
如果我使用 \mcanswerslist 环境并将 \includegraphics 放在 \answer 中,它可以正常工作:
\documentclass[a4paper]{article}
\usepackage[output=exam
,numberofversions=2
,version=1
,seed=1
,randomizequestions=false
,randomizeanswers=true
,writeRfile=true
]{mcexam}
\usepackage{array}
\usepackage{graphicx}
\begin{document}
\begin{mcquestions}
\question Which symbol means flammable?
\begin{mcanswerslist}
\answer \includegraphics[scale=.3]{example-image.png}
\answer [correct] \includegraphics[scale=.3]{example-image.png}
\end{mcanswerslist}
\end{mcquestions}
\end{document}
我想将答案列表格式化为 2 列以节省空间。我尝试了 \mcanswerslist 环境中的 \minipage 环境,但没有成功。
抱歉,我不知道如何在我的帖子中包含实际的图形文件,但您可以替换您自己的图形文件。
答案1
不确定这个包在做什么,但你可以\includegraphcs
在一个额外的{}
组中保护它:
\documentclass[a4paper]{article}
\usepackage[output=exam
,numberofversions=2
,version=1
,seed=1
,randomizequestions=false
,randomizeanswers=true
,writeRfile=true
]{mcexam}
\usepackage{array}
\usepackage{graphicx}
\begin{document}
\begin{mcquestions}
\question Which symbol means flammable?
\begin{mcanswers}
\begin{tabular}{m{.5cm}m{3cm}}
& Col2 \\
& Col2 \\
\answernum{1} & \answer{1} {\includegraphics[scale=.3]{example-image.png}} \\
\answernum{2} & \answer[correct]{2} {\includegraphics[scale=.3]{example-image.png}}\\
\end{tabular}
\end{mcanswers}
\end{mcquestions}
\end{document}