在 LaTeX 中创建多项选择题

发布于 2024-10-18 21:55:24 字数 1243 浏览 6 评论 0 原文

我正在尝试用 LaTeX 做一道多项选择题。我有点困惑是否

\begin{问题}{MultipleChoice}

是 LaTeX 默认可以处理的东西,还是我需要额外的包、描述等...(我对 LaTex 非常陌生)。

话虽这么说,如果我运行以下代码,我不会得到多项选择问题,而是得到一个错误,提示“孤独\项目 - 也许缺少列表环境”。

预先感谢您的时间和耐心!

  %%%% 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}

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}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

深府石板幽径 2024-10-25 21:55:24

更好地使用考试课程

Better use the exam class

美人骨 2024-10-25 21:55:24

这是一个使用 exam 类的简单示例:

\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}

这将产生如下内容:
在此处输入图像描述

有关更多详细信息,请参阅 考试课程指南。

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.

清风不识月 2024-10-25 21:55:24

考试课程可以与一些变化一起使用。

这里是考试类的文档

并使用对其进行自定义。

记住:这是一个类而不是包。在输入任何内容之前请仔细阅读文档。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文