# How can I insert text inside the aligned environment?

I often need to insert text and breaks in between equations but it's too cumbersome to type aligned again from beginning. What can I do to insert text inside the aligned environment ?

Also, is there any difference between align and aligned ? The former gives compile errors on my computer .

• Here is useful link: tex.stackexchange.com/a/49541/10898 – azetina Jun 26 '16 at 3:20
• @azetina Can I do this with aligned since I'm facing problems with align ? – Saikat Jun 26 '16 at 3:30
• I believe so. Give it a try. – azetina Jun 26 '16 at 3:30
• @azetina Intertext doesn't work well with aligned. What do you think is a good way of writing proofs where explanations are require in between equations ? But, at the same time there has to be some continuity like alignment. – Saikat Jun 26 '16 at 3:55
• Could you post waht you've tried? The difference between align and aligned is the latter has to be used when you're already in math mode (e.g. àligned inside gather or \begin{aligned}…\end{aligned} for inline maths). – Bernard Jun 26 '16 at 10:32

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
\sqrt{|a_{11} + b_{11} + \dots a_{nn} + a_{nn}|} & \leq \sqrt{|a_{11} + \dots + a_{nn}|} + \sqrt{|b_{11} + \dots + b_{nn}|}\\
x &= \sqrt{|a_{11} + b_{11} + \dots a_{nn} + a_{nn}|} \notag\\
y &= \sqrt{|a_{11} + \dots + a_{nn}|} \notag\\
z &= \sqrt{|b_{11} + \dots + b_{nn}|}\notag\\
x & \leq  y + z  \notag\\
&= Square~{} each~{} element ~{}x, ~{}y ~{}and~{} z~{}and ~{} compute
\end{align}
\end{document}


• Can you explain why you wrote ~{} so many times in the last line ? – Saikat Jun 26 '16 at 5:59
• Also, can you do it with aligned ? I'm getting compile errors with align. – Saikat Jun 26 '16 at 6:00
• I figured out the error ! Align, unlike aligned should not be preceded by dollar signs ! Thanks ! Now, can you give some other options on how to insert text like Intertext or something ? – Saikat Jun 26 '16 at 6:29
• that last line could be written better as &= \text{Square each element x, y and z and computer} Also, mathtools improves upon amsmath – Runar Jun 26 '16 at 8:02
• @murugan I think it should be written with \text, though I would say \text{Square each element $x$, $y$ and $z$ and compute}. The words *Square each element.. are just that, words, they're not mathematical constructs, and should be treated thereafter. – Torbjørn T. Jun 26 '16 at 12:48