如何使用“任务”包在 MCEXAM 包中水平而不是垂直枚举?

如何使用“任务”包在 MCEXAM 包中水平而不是垂直枚举?

如何使用任务包将选项设置为

AB

光盘

Multicols 将选项设置为

交流电

屋宇署

见截图。在此处输入图片描述

这是 mwe

\documentclass[twoside]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{mathpazo}
\usepackage{tasks}
\usepackage{etoolbox}

% mcexams options.
\usepackage[output=concept
           ,numberofversions=2
           ,version=1
           ,seed=1
           ,randomizequestions=true
           ,randomizeanswers=false
           ,writeRfile=false
           ]{mcexam}

\usepackage{calc}
\renewenvironment{setmcquestion}{\begin{minipage}[t]{\linewidth-\labelwidth}}{\end{minipage}\par}
\usepackage{multicol}

\begin{document}


%%%%%%%%%%%%%%%%%%%%%%%%
% BEGIN EXAM QUESTIONS %
%%%%%%%%%%%%%%%%%%%%%%%%

\begin{mcquestions}

\question Example 1 using multicol  Which of the following numbers is prime? This shows how \texttt{multicol} can be used to format options all on one line.

\begin{multicols}{2}
\begin{mcanswerslist}[ordinal]
    \answer 12
    \answer 16
    \answer[correct] 17
    \answer 20
\end{mcanswerslist}
\end{multicols}

\question No package Example 2 Which of the following numbers is prime? This shows how \texttt{multicol} can be used to format options all on one line.
\begin{mcanswerslist}[ordinal]
\answer 12
\answer 16
\answer[correct] 17
\answer 20
\end{mcanswerslist}


\question Example 3 If $E_1, E_2$ and $E_3$  represent respectively the kinetic energies of an electron, an alpha particle and a proton each having same de Broglie wavelength than
\begin{mcanswerslist}
\answer[correct]{ (a*)  $ E_1 > E_3 > E_2 $}
\answer{ (b) $ E_2 > E_3 > E_1 $ }
\answer{ (c) $ E_1 > E_2 > E_3 $ }
\answer{ (d)  $ E_1 = E_3 = E_2 $}
\end{mcanswerslist}


\end{mcquestions}

 
\end{document}

仅供参考,这与此非常相似问题 我无法弄清楚语法。

提前致谢

答案1

\documentclass[twoside]{article}
\usepackage[T1]{fontenc}
\usepackage{mathpazo}
\usepackage{tasks}
\usepackage{etoolbox}

% mcexams options.
\usepackage[output=concept
           ,numberofversions=2
           ,version=1
           ,seed=1
           ,randomizequestions=true
           ,randomizeanswers=false
           ,writeRfile=false
           ]{mcexam}

\usepackage{calc}
\renewenvironment{setmcquestion}{\begin{minipage}[t]{\linewidth-\labelwidth}}{\end{minipage}\par}
\usepackage{multicol}

\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%
% BEGIN EXAM QUESTIONS %
%%%%%%%%%%%%%%%%%%%%%%%%

\begin{mcquestions}

\question Example 1 using multicol Which of the following numbers is prime? This shows how \texttt{multicol} can be used to format options all on one line.

\begin{multicols}{2}
\begin{mcanswerslist}[ordinal]
    \answer 12
    \answer 16
    \answer[correct] 17
    \answer 20
\end{mcanswerslist}
\end{multicols}

\question No package Example 2 Which of the following numbers is prime? This shows how \texttt{multicol} can be used to format options all on one line.
\begin{mcanswerslist}[ordinal]
\answer 12
\answer 16
\answer[correct] 17
\answer 20
\end{mcanswerslist}

\question Example 3 If $E_1, E_2$ and $E_3$ represent respectively the kinetic energies of an electron, an alpha particle and a proton each having same de Broglie wavelength than
\begin{mcanswerslist}
\answer[correct]{ (a*) $ E_1 > E_3 > E_2 $}
\answer{ (b) $ E_2 > E_3 > E_1 $ }
\answer{ (c) $ E_1 > E_2 > E_3 $ }
\answer{ (d) $ E_1 = E_3 = E_2 $}
\end{mcanswerslist}

With tasks:
\begin{tasks}[label=(\alph*)](2)
\task\: (a*) $ E_1 > E_3 > E_2 $
\task\: (b) $ E_2 > E_3 > E_1 $
\task\: (c) $ E_1 > E_2 > E_3 $
\task\:(d) $ E_1 = E_3 = E_2 $
\end{tasks}

\end{mcquestions}

\end{document} 

在此处输入图片描述

相关内容