Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to align separated equations in LaTeX?

I can use the align environment to properly align non-separated equations like this:

begin{align}
a^2 + b^2 &= c^2\\
          &= d
\end{align}

but how can I align separated equations with text inbetween? For example:

\documentclass[12pt, a4paper]{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}

\begin{document}

My first equation:

\begin{equation}
a^2 + b^2 &= c^2
\end{equation}

My second equation:

\begin{equation}
1 = 3 - 2
\end{equation}
\end{document}

I would like the two equations to be aligned at the equality sign.

like image 874
Anno Avatar asked Sep 15 '25 13:09

Anno


1 Answers

You could place both equations in an align environment and add the text in between with \intertext{...}:

\documentclass[12pt, a4paper]{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}

\begin{document}

My first equation:

\begin{align}
a^2 + b^2 &= c^2\\     
\intertext{My second equation:}
          &= d
\end{align}
\end{document}

enter image description here

like image 90
samcarter_is_at_topanswers.xyz Avatar answered Sep 17 '25 18:09

samcarter_is_at_topanswers.xyz