0

Sometimes I am writing an aligned list of equations, but I need to break them in the middle to add a comment, like:

enter image description here

Code:

\documentclass{article}
\usepackage[utf8]{inputenc}

\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{thmtools}       

\setlength\parindent{0pt}
\usepackage[linesnumbered,ruled]{algorithm2e}
\usepackage{hyperref}
\usepackage{caption} 
\usepackage{cleveref}

\begin{document}
\section{Introduction}

\begin{align*}
    W(z) = A^TAB + \sum\limits_{\omega \in \sigma} a^2 V(z)\int_0^T rm(\theta)d\theta
\end{align*}
Obviously $A^TAB \leq 0$, therefore
\begin{align*}
    W(z) \leq \sum\limits_{\omega \in \sigma} a^2 V(z)\int_0^T rm(\theta)d\theta
\end{align*}

\end{document}

But it would be better for the equations to remain aligned

enter image description here

What is the best way to accomplish this?

Fraïssé
  • 3,139
  • Use an align environment, with \intertext{..} or \shortintertext{..} inside that environment. With mathtools get the \shortintertext (\intertext is there with amsmath). – Manuel Mar 09 '17 at 23:24

1 Answers1

2

Use the \intertext command to typeset the text. Then you can reduce your example to one environment and align it to your desire:

\begin{align*}
    W(z) &= A^TAB + \sum\limits_{\omega \in \sigma} a^2 V(z)\int_0^T rm(\theta)d\theta
\intertext{Obviously $A^TAB \leq 0$, therefore}
    W(z) &\leq \sum\limits_{\omega \in \sigma} a^2 V(z)\int_0^T rm(\theta)d\theta
\end{align*}

With the result:

align with \intertext


As Manuel and Bernard mentioned, \shortintertext might be nicer here, if you're willing to go for the mathtools package. In this case you obtain a slightly more dense result:

align with \shortintertext

Timm
  • 803