\begin{enumerate}
\item[1.] Choose $N\sim \text{Poisson}(\xi)$.
\item[2.] Choose $\theta \sim \text{Dir}(\alpha)$.
\item[3.] For each of the $N$ words $w_n$:
\begin{enumerate}
\item[(a)] Choose a topic $z_n \sim \text{Multinomial}(\theta)$.
\item[(b)] Choose a word $w_n$ from $p(w_n | z_n, \beta)$, a multinomial probability conditioned on the topic $z_n$.
\end{enumerate}
\end{enumerate}
当我使用上述代码生成一些方程式时,它给出了以下错误:
Undefined control sequence. \item[1.] Choose $N\sim \text
Undefined control sequence. \item[2.] Choose $\theta \sim \text
Undefined control sequence. \item[(a)] Choose a topic $z_n \sim \text
我不明白是什么导致了这些错误。有人能帮忙吗?谢谢。
答案1
我只想添加一种更简单的方法来使用枚举,enumitem
它使用您手动输入的内容作为默认值:
\documentclass{article}
\usepackage{showframe}
\renewcommand{\ShowFrameLinethickness}{0.3pt}
\usepackage{enumitem}
\usepackage{amsmath}
\begin{document}
\begin{enumerate}[ wide = 0pt, leftmargin = *]
\item Choose $N\sim \text{Poisson}(\xi)$.
\item Choose $\theta \sim \mathrm{Dir}(\alpha)$.
\item For each of the $N$ words $w_n$:
\begin{enumerate}[wide = 0pt]
\item Choose a topic $z_n \sim \mathrm{Multinomial}(\theta)$.
\item Choose a word $w_n$ from $p(w_n \,|\, z_n, \beta)$, a multinomial probability conditioned on the topic $z_n$.
\end{enumerate}
\end{enumerate}
\end{document}