2

I have the following set of subequations (amsmath):

\begin{subequations}
\begin{alignat}{3}
&\frac{\partial^2 \, (r \, \Pi_{1 \perp}^e)}{\partial r^2}+k^2 \, r \, \Pi_{1 \perp}^e &= E \, \varepsilon \, \sin{\vartheta} \, \sin{\varphi} \cdot e^{i \, k \, R + i \, \omega t}\\
\shortintertext{}
&\frac{1}{r} \, \frac{\partial^2 (r \, \Pi_{1 \perp}^e)}{\partial r \partial \vartheta}-i \, k \, \sqrt{\frac{\varepsilon}{\mu}} \, \frac{1}{\sin{\vartheta}} \, \frac{\partial \Pi_{2 \perp}^e}{\partial \varphi} &= E \, \varepsilon \, \cos{\theta} \, \sin{\varphi} \cdot e^{i \, k \, R + i \, \omega \, t}\\
\shortintertext{}
&\frac{1}{r \, \sin{\vartheta}} \, \frac{\partial^2 (r \, \Pi_{1 \perp}^e)}{\partial r \partial \varphi}+i \, k \, \sqrt{\frac{\varepsilon}{\mu}} \, \frac{\partial \Pi_{2 \perp}^e}{\partial \vartheta} &= E \, \cos{\varphi} \cdot e^{i \, k \, R+i \, \omega \, t}
\end{alignat}
\end{subequations}

(Try to ignore the math) I'm trying to align them at the beginning and at the equal sign, so it looks like this:

enter image description here

(Original German document I'm translating, By J. Meixner). Here's what mine looks like:

enter image description here

As you can see, it aligns correctly at the beginning but not at the equal signs. How can I make it line up?

1
  • I would personally use \theta, \epsilon and \phi, and redefine them in the preamble, I see no reason to use \var··· when the two variants are not present in the document.
    – Manuel
    Jun 5, 2015 at 14:47

1 Answer 1

3

You have been using the alingat wrong. You have to put two & signs at the second point, as each alignment mark alternates between left alignment and right alignment.

I would not use all those spaces as it results in too much white space and therefore typographical errors.

If you want to increase the vertical distance between the rows, just use \\[1cm] or similar. Please do not misuse the \shortintertext for this, at it is syntactically confusing.

% arara: pdflatex

\documentclass{article}
\usepackage{mathtools}

\begin{document}
\setcounter{equation}{38} % remove this
\begin{subequations}
    \begin{alignat}{3}
        &\frac{\partial^2 (r\Pi_{1 \perp}^e)}{\partial r^2}+k^2 r \Pi_{1 \perp}^e &&= \varepsilon E \sin\vartheta \sin\varphi \cdot e^{i k R + i \omega t}\\[\jot] % or any other measure
        &\frac{1}{r}\,\frac{\partial^2 (r \Pi_{1 \perp}^e)}{\partial r \partial \vartheta}-i k \sqrt{\frac{\varepsilon}{\mu}}\,\frac{1}{\sin\vartheta}\,\frac{\partial \Pi_{2 \perp}^e}{\partial \varphi} &&= \varepsilon E \cos\theta \sin{\varphi} \cdot e^{i k R + i \omega t}\\[\jot]
        &\frac{1}{r \sin{\vartheta}}\,\frac{\partial^2 (r \Pi_{1 \perp}^e)}{\partial r \partial \varphi}+i k \sqrt{\frac{\varepsilon}{\mu}}\,\frac{\partial \Pi_{2 \perp}^e}{\partial \vartheta} &&= E \cos\varphi \cdot e^{i k R+i \omega t}
    \end{alignat}
\end{subequations}
\setcounter{equation}{38} % remove that
\begin{subequations}
    \begin{align}
    \frac{\partial^2 (r\Pi_{1 \perp}^e)}{\partial r^2}+k^2 r \Pi_{1 \perp}^e &= \varepsilon E \sin\vartheta \sin\varphi \cdot e^{i k R + i \omega t}\\[\jot] % or any other measure
    \frac{1}{r}\,\frac{\partial^2 (r \Pi_{1 \perp}^e)}{\partial r \partial \vartheta}-i k \sqrt{\frac{\varepsilon}{\mu}}\,\frac{1}{\sin\vartheta}\,\frac{\partial \Pi_{2 \perp}^e}{\partial \varphi} &= \varepsilon E \cos\theta \sin{\varphi} \cdot e^{i k R + i \omega t}\\[\jot]
    \frac{1}{r \sin{\vartheta}}\,\frac{\partial^2 (r \Pi_{1 \perp}^e)}{\partial r \partial \varphi}+i k \sqrt{\frac{\varepsilon}{\mu}}\,\frac{\partial \Pi_{2 \perp}^e}{\partial \vartheta} &= E \cos\varphi \cdot e^{i k R+i \omega t}
    \end{align}
\end{subequations}
\end{document}

enter image description here


As I do not like the formatting of those lines, I added another way with just one alignment. Much easier to read in my opinion.

3
  • @NimrodSadeh glad to hear that. You are welcome.
    – LaRiFaRi
    Jun 5, 2015 at 14:55
  • 1
    +1. I'd be tempted to throw in a thinspace between consecutive \frac terms, to create a slightly more open look. The extra bit of whitespace between fractions would seem to be present in the original. I'd also create a bit of whitespace between E and \varepsilon in the first two subequations, by declaring E to be a math operator, e.g., via the instruction \DeclareMathOperator{\E}{\mathit{E}}.
    – Mico
    Jun 5, 2015 at 14:59
  • @Mico Thanks. As always, you have a good eye. Adapted that. For the E... not sure I like that. I changed to my gusto but please leave the comment as it is of course a correct solution, too.
    – LaRiFaRi
    Jun 5, 2015 at 15:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .