我怎样才能水平排列 \choice?

我怎样才能水平排列 \choice?

exam-randomizechoices这样用

%\documentclass[12pt,a4paper]{exam}
\documentclass[12pt,a4paper,answers]{exam}
\usepackage[randomize,overload]{exam-randomizechoices}
\newcommand{\correctchoicelabel}{\fbox{\thechoice}}
\CorrectChoiceEmphasis{\renewcommand{\choicelabel}{\correctchoicelabel}}

\begin{document}
    \section{Questions}
    \begin{questions}
        \question What is 2+2?
        \begin{choices}
            \choice 1
            \choice 2
            \choice 3
            \CorrectChoice 4
        \end{choices}

        \question What is 2+2?
        \begin{choices}
            \choice 1
                \CorrectChoice 4
            \choice 2
            \choice 3
        
        \end{choices}
        
        \question What is the result of $1+2$?
        \begin{choices}
             \choice 1
             \choice 2
             \CorrectChoice 3
             \choice 4
        \end{choices}
    
    \question What is the result of $1+1$?
    2
        \begin{choices}
         \choice 1
         \CorrectChoice 2
         \choice 3
         \choice 4
    \end{choices}

                
    \end{questions}
    \subsection{Keys}
    \centering
    \printkeytable
\end{document}

我怎样才能水平排列 \choice?

在此处输入图片描述

答案1

使用oneparchoices环境代替环境choices,并在之前插入一个空行 \begin{oneparchoices}

\documentclass[12pt,a4paper,answers]{exam}
\usepackage[randomize,overload]{exam-randomizechoices}
\newcommand{\correctchoicelabel}{\fbox{\thechoice}}
\CorrectChoiceEmphasis{\renewcommand{\choicelabel}{\correctchoicelabel}}

\begin{document}
    \section{Questions}
    \begin{questions}
        \question What is 2+2?
        
        \begin{oneparchoices} %<<<<<<<<<<< with  blank line before
            \choice 1
            \choice 2
            \choice 3
            \CorrectChoice 4
        \end{oneparchoices}
        
        \question What is 2+2?
        
        \begin{oneparchoices}
            \choice 1
            \CorrectChoice 4
            \choice 2
            \choice 3               
        \end{oneparchoices}
        
        \question What is the result of $1+2$?
        
        \begin{oneparchoices}
            \choice 1
            \choice 2
            \CorrectChoice 3
            \choice 4
        \end{oneparchoices}
        
        \question What is the result of $1+1$?

        \begin{oneparchoices}
            \choice 1
            \CorrectChoice 2
            \choice 3
            \choice 4
        \end{oneparchoices}
                    
    \end{questions}

    \subsection{Keys}
    \centering
    \printkeytable
\end{document}

A

相关内容