Is there an environment / modification that:
- Works within a display math environment
begin{equation}
- Allows for alignment of lines.
- Allows equation number to be aligned with any specific line, e.g. the last of multiple aligned lines, instead of the equation number being vertically centered?
According to wikibooks, there are four environments from amsmath
that works within display math:
gathered
: Allows gathering equations to be set under each other and assigned a single equation number.
split
: Similar to align, but used inside another displayed mathematics environment.*
aligned
: Similar to align, to be used inside another mathematics environment.
alignedat
: Similar to alignat, and likewise takes an additional argument specifying the number of columns of equations to set.
If I use any of those four environments within an \begin{equation}
, then I get a label centered around the whole math block. For example here with aligned
\begin{equation}
\begin{aligned}
(a+b)^2 = (a + b)(a + b) \\
= a^2 + ab + ba + b^2 \\
= a^2 + 2ab + b^2
\end{aligned}
\end{equation}
Can this number be aligned with any of the three lines, if it must happen within an equation
environment?
Use case: Writing in Typora, only TeX notation $$...$$
gives a live preview for display math, and this is converted by pandoc into \begin{equation}...\end{equation}
, so I'm constrained to work in equation
environment if I want live preview in-editor.
Best Answer
Here's a demo.
To your list of alignments within a display maths, you can add
multlined
, provided bymathtools
, which is an extension ofamsmath
.