如何将数字参数传递给Latex环境

时间:2009-09-06 07:39:35

标签: latex numeric

我已将环境定义为

\newenvironment{question}[1]
{Question (#1 points):}{}

我用它作为

\begin{question}[10]
...
\end{question}

我收到以下错误:

Missing number, treated as zero
\begin{question}[
                 10]

1 个答案:

答案 0 :(得分:7)

正确的语法是大括号,而不是方括号:

\begin{question}{10}
What is the airspeed velocity of an unladen swallow?
\end{question}