是否可以对在数学模式下编写的方程式进行编号?我尝试在数学模式下使用“\begin{equation}”,但会出现错误。
\documentclass{article}
\usepackage[french,USenglish]{babel}
\usepackage[mmddyyyy]{datetime}
\usepackage{amsmath,amssymb}
\begin{document}
I can number the equations using ``begin{equation}''.
\begin{equation}
A = \frac{\pi r^2}{2}
\end{equation}
But, how to number the equations in written using math mode?
\[\mathrm{ \frac {P \models Q\stackrel{Y} {\rightleftharpoons} P \mbox{, } P \lhd \langle X \rangle _Y} {P \models Q \rhd X} } \]
\[\mathrm{ \frac {P \models Q, P \lhd \langle X \rangle _Y} {Q \rhd X} } \]
\end{document}
答案1
我认为(但我可能错了)gather
环境可能就是您要找的东西。请注意,显示样式的数学在环境内有效gather
。
\documentclass{article}
\usepackage[french,USenglish]{babel}
\usepackage[mmddyyyy]{datetime}
\usepackage{amsmath,amssymb}
\begin{document}
I can number a single-line equation using an \texttt{equation} environment.
\begin{equation}
A = \frac{\pi r^2}{2}
\end{equation}
I can number multi-line mathmode material with a \texttt{gather} environment.
\begin{gather}
\mathrm{ \frac {P \models Q\stackrel{Y} \rightleftharpoons P ,\
P \mathrel\lhd \langle X \rangle _Y} {P \models Q
\mathrel\rhd X} } \\[1ex] % "1ex" inserts a bit more vertical whitespace
\mathrm{ \frac {P \models Q,\
P \mathrel\lhd \langle X \rangle _Y} {Q \mathrel\rhd X} }
\end{gather}
\end{document}