我怎样才能在方程式前面写数字(枚举)?如果我用 \item 书写,枚举数字和方程式之间会有很大空间。
答案1
答案2
在您展示的图片中,数字悬挂在虚无之中,并且公式的中心位置没有任何意义。
下面,公式与数字位于同一行,以两个四边形分隔。
\documentclass{article}
\usepackage{amsmath}
\usepackage{enumitem}
\usepackage{showframe}% just for the example
\begin{document}
\begin{enumerate}[itemsep=\baselineskip,itemindent=2em,labelsep=2em]
\item $\displaystyle \prod_{k=2}^{\infty}\left(1-\frac{2}{k(k+1)}\right)=\frac{1}{3}$
\item $\displaystyle \prod_{k=2}^{\infty}\left(1-\frac{2}{k^{3}+1)}\right)=\frac{2}{3}$
\item \begin{tabular}[t]{@{}c@{}}
$\displaystyle \prod_{k=1}^{\infty}
\left(\frac{2k}{2k-1}\right)
\left(\frac{2k}{2k+1}\right)=
\frac{2}{1}\cdot\frac{2}{3}\cdot\frac{4}{3}\cdot
\frac{4}{5}\cdot\frac{6}{5}\cdot\frac{6}{7}\dots=\frac{\pi}{2}$
\\
\bfseries (Wallis's formula)
\end{tabular}
\end{enumerate}
\end{document}
仅提一下原文的排版方式:
\documentclass{article}
\usepackage{amsmath}
\usepackage{showframe} % just for the example
\begin{document}
\begin{enumerate}
\item \[\prod_{k=2}^{\infty}\left(1-\frac{2}{k(k+1)}\right)=\frac{1}{3}\]
\item \[\prod_{k=2}^{\infty}\left(1-\frac{2}{k^{3}+1)}\right)=\frac{2}{3}\]
\item \begin{gather*}
\prod_{k=1}^{\infty}
\left(\frac{2k}{2k-1}\right)
\left(\frac{2k}{2k+1}\right)=
\frac{2}{1}\cdot\frac{2}{3}\cdot\frac{4}{3}\cdot
\frac{4}{5}\cdot\frac{6}{5}\cdot\frac{6}{7}\dots=\frac{\pi}{2}
\\
\textbf{(Wallis's formula)}
\end{gather*}
\end{enumerate}
\end{document}
答案3
将方程式置于中心并将数字放在左边的示例。
\documentclass{article}
\newcounter{eqitem}
\newcommand*{\eqitem}[1]{%
\refstepcounter{eqitem}%
\[
\hbox to \displaywidth{$\displaystyle
\rlap{\theeqitem.}%
\hfil#1\hfil
$}%
\]%
}
\begin{document}
\setcounter{eqitem}{0}
\eqitem{\prod_{k=2}^\infty \left(1 - \frac{2}{k(k+1)}\right) = \frac{1}{3}}
\eqitem{\prod_{k=2}^\infty \left(1 - \frac{2}{k^3 + 1}\right) = \frac{2}{3}}
\eqitem{\prod_{k=2}^\infty \left(1 + \frac{1}{2^k - 2}\right) = 2}
\end{document}
此外,还可以定义一个环境:
\documentclass{article}
\newcounter{eqitem}
\newcommand*{\eqitem}[1]{%
\refstepcounter{eqitem}%
\[
\hbox to \displaywidth{$\displaystyle
\rlap{\theeqitem.}%
\hfil#1\hfil
$}%
\]%
}
\newenvironment*{eqitemize}{%
\setcounter{eqitem}{0}%
\let\item\eqitem
}{}
\begin{document}
\begin{eqitemize}
\item{\prod_{k=2}^\infty \left(1 - \frac{2}{k(k+1)}\right) = \frac{1}{3}}
\item{\prod_{k=2}^\infty \left(1 - \frac{2}{k^3 + 1}\right) = \frac{2}{3}}
\item{\prod_{k=2}^\infty \left(1 + \frac{1}{2^k - 2}\right) = 2}
\end{eqitemize}
\end{document}