我尝试在公式中插入文本,但文档中没有正确介绍这种方法amsmath
。这些解决方案包括在公式之间插入文本,而我尝试将其插入到对齐语句的中间:
\begin{align}
\mathfrak{E}_x^e+\mathfrak{E}_x^b = 0, \quad \mathfrak{E}_y^e&+\mathfrak{E}_y^b = 0, \quad \mathfrak{B}_z^e+\mathfrak{B}_z^b = 0
\shortintertext{on F,}
\frac{\partial}{\partial z} (\mathfrak{E}_z^e+\mathfrak{E}_z^b) = 0, \quad \frac{\partial}{\partial z} (\mathfrak{B}_x^e&+\mathfrak{B}_x^b) = 0,\quad \frac{\partial}{\partial z} (\mathfrak{E}_z^e+\mathfrak{E}_z^b) = 0
\end{align}
编译结果如下:
我希望这两个语句都被编号为 (5),也就是说,数字 5 出现在中间的行上(在 F, 上),而另外两个数字则消失。
答案1
这是一个非常肮脏的伎俩,一旦你改变编号方案,它就会像玻璃一样破碎。
\documentclass{article}
\usepackage{mathtools}
\usepackage{showframe}
\def\mathfrak#1{#1}%<- I simply cannot remember which package is needed, and it is not relevant to the question.
\begin{document}
\begin{align}
\mathfrak{E}_x^e+\mathfrak{E}_x^b = 0, \quad
\mathfrak{E}_y^e&+\mathfrak{E}_y^b = 0, \quad
\mathfrak{B}_z^e+\mathfrak{B}_z^b = 0
\shortintertext{on F,}
\frac{\partial}{\partial z}
(\mathfrak{E}_z^e+\mathfrak{E}_z^b) = 0, \quad
\frac{\partial}{\partial z}
(\mathfrak{B}_x^e&+\mathfrak{B}_x^b) = 0,\quad
\frac{\partial}{\partial z}
(\mathfrak{E}_z^e+\mathfrak{E}_z^b) = 0
\end{align}
\begin{align*}
\refstepcounter{equation}
\mathfrak{E}_x^e+\mathfrak{E}_x^b = 0, \quad
\mathfrak{E}_y^e&+\mathfrak{E}_y^b = 0, \quad
\mathfrak{B}_z^e+\mathfrak{B}_z^b = 0
\shortintertext{on F,\hfill(\theequation)}
\frac{\partial}{\partial z}
(\mathfrak{E}_z^e+\mathfrak{E}_z^b) = 0, \quad
\frac{\partial}{\partial z}
(\mathfrak{B}_x^e&+\mathfrak{B}_x^b) = 0,\quad
\frac{\partial}{\partial z}
(\mathfrak{E}_z^e+\mathfrak{E}_z^b) = 0
\end{align*}
\end{document}
答案2
这是另一个肮脏的伎俩。(不确定你为什么使用align
;gather
对我来说似乎更合适。但aligned
在这里也应该有效。)
\documentclass{article}
\usepackage{mathtools,amsfonts}
\begin{document}
\begin{align}
\mathfrak{E}_x^e+\mathfrak{E}_x^b = 0, \quad \mathfrak{E}_y^e&+\mathfrak{E}_y^b = 0, \quad \mathfrak{B}_z^e+\mathfrak{B}_z^b = 0
\shortintertext{on F,}
\frac{\partial}{\partial z} (\mathfrak{E}_z^e+\mathfrak{E}_z^b) = 0, \quad \frac{\partial}{\partial z} (\mathfrak{B}_x^e&+\mathfrak{B}_x^b) = 0,\quad \frac{\partial}{\partial z} (\mathfrak{E}_z^e+\mathfrak{E}_z^b) = 0
\end{align}
some text
\begin{equation}
\begin{gathered}
\mathfrak{E}_x^e+\mathfrak{E}_x^b = 0, \quad \mathfrak{E}_y^e +\mathfrak{E}_y^b = 0, \quad \mathfrak{B}_z^e+\mathfrak{B}_z^b = 0\\
\makebox[.5\textwidth]{\llap{\kern-.5\textwidth\rlap{on F,}\hfil}\null\hfill}\\
\frac{\partial}{\partial z} (\mathfrak{E}_z^e+\mathfrak{E}_z^b) = 0, \quad \frac{\partial}{\partial z} (\mathfrak{B}_x^e +\mathfrak{B}_x^b) = 0,\quad \frac{\partial}{\partial z} (\mathfrak{E}_z^e+\mathfrak{E}_z^b) = 0
\end{gathered}
\end{equation}
\end{document}