3

I am trying to make a multiple choice question in LaTeX. I am a little confused as to whether

\begin{question}{MultipleChoice}

is something that LaTeX can handle by default or do I need extra packages, descriptions, ect...(I am super new to LaTex).

That being said, if I run the following code I do not get a multiple choice question, but rather an error that says 'lonely \item - perhaps missing a list environment.

Thanks in advance for your time and patience!

  %%%% ENVIRONMENT FOR LIST FOR QUESTIONS LIST %%%%
    \newenvironment{questions}{ %   %%%% Begin preliminary environment code
        \begin{list}{ %     %%%% Begin list item label code
            \bfseries\upshape\arabic{qcounter}:
        }{ %    %%%% Begin list item body code
            \usecounter{qcounter}
            \setlength{\labelwidth}{1in}
            \setlength{\leftmargin}{0.25in}
            \setlength{\labelsep}{0.5ex}
            \setlength{\itemsep}{2em}
        } %%%%% End list item body code
    }{        %%%%% Begin wrapup environment code
        \end{list}
    } %%%%% End wrapup environment code

    %%%% ENVIRONMENT FOR A SINGLE QUESTION %%%%
    \newenvironment{question}{\item{}}{}



    \begin{question}{MultipleChoice}
    \qutext{$3\log x-2\log y=$}
    \choice*{$\log\left(\displaystyle\frac{x^3}{y^2}\right)$}
    \choice{$\log(x^3y^2)$}
    \choice{$\log(3x-2y)$}
    \choice{$\log(x^3-y^2)$}
    \end{question}
Michael
  • 1,537
  • 6
  • 20
  • 42

3 Answers3

5

Better use the exam class

Eelvex
  • 8,975
  • 26
  • 42
  • I got Forbidden on the first three tries. The fourth was successful. You might want to add that `texdoc exam` gives the installations current documentation (lots of old installs out there; ubuntu I'm looking at you!) – Captain Giraffe Dec 22 '12 at 15:00
3

Here is a smiple example using the exam class:

\documentclass{exam}
\begin{document}
\begin{questions}
  \question [3] What is the right choice of the following choices?
    \begin{choices}
      \choice first choice
      \choice second choice
    \end{choices}
  \end{questions}
\end{document}

This will produce something like this: enter image description here

For more details see section: 5 in the exam class guide.

Aziz Alto
  • 19,057
  • 5
  • 77
  • 60
0

Exam class can be used alongside some changes.

Here is the doc for Exam class.

And customize it using this.

Remember: This is a class not a package. Read the doc carefully before you go to type anything.

lRadha
  • 641
  • 6
  • 16