TransWikia.com

Vertical alignment several labeled equations (can be referenced later) at not-consecutive lines

TeX - LaTeX Asked on April 23, 2021

In the following situation, I want to vertical align the equal signs = in labeled (H) and (NH) equations (so they can be referenced later using eqref) at not-consecutive lines. How could I do it?

The way in here does not work for using eqred later.

enter image description here

documentclass[12pt]{article}
usepackage{amsmath,amsthm,amssymb}
begin{document}
Consider the {itshape homogeneous} linear differential equation
begin{equation}
    tag{H}
    label{eq:H2}
    y''+p(x)y'+q(x)y=0
end{equation}
and {itshape nonhomogeneous} linear differential equation
begin{equation}
    tag{NH}
    label{eq:NH2}
    y''+p(x)y'+q(x)y=f(x)
end{equation}
where $p(cdot)$, $q(cdot)$, and $f(cdot)$ be continuous functions on some open interval $(a,b)$. The homogeneous equation eqref{eq:H2} always have a solution $y=0$ called {itshape the trivial solution}.
end{document}

One Answer

Use align with intertext (both features of amsmath)

documentclass[12pt]{article}
usepackage{amsmath,amsthm,amssymb}
begin{document}
Consider the textit{homogeneous} linear differential equation
begin{align}
    tag{H}
    label{eq:H2}
    y''+p(x)y'+q(x)y &= 0
intertext{and textit{nonhomogeneous} linear differential equation}
    tag{NH}
    label{eq:NH2}
    y''+p(x)y'+q(x)y &= f(x)
end{align}
where $p(cdot)$, $q(cdot)$, and $f(cdot)$ be continuous functions on some
open interval $(a,b)$. The homogeneous equation eqref{eq:H2} always have a
solution $y=0$ called textit{the trivial solution}.
end{document}

enter image description here

(I replaced {itshape...} by textit{...} but that's just my taste.)

Correct answer by campa on April 23, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP