3

I'm trying to insert text inside an equation in a way not properly covered by the amsmath documentation. These solutions cover inserting text between equations, and I'm trying to insert it in the middle of an aligned statement:

\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}

Which compiles to this:

enter image description here

I'd like for the two statements to be both numbered (5), that is, that the number 5 appear on the line in the middle (on F,), and that the two other numbers disappear as a result.

  • I don't think this will be understandable by your readers. What would the number refer to? – egreg Jun 1 '15 at 16:50
3

A really dirty trick, as soon as you change the numbering scheme, this will break like glass.

nimrodNumberAlign

\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}
3

here's another dirty trick. (not sure why you used align; gather seems more appropriate to me. but aligned should work as well here.)

\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}

output of example code

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.