0

I have some text following equations that are separated by paragraphs (so I can't use \intertext). I would like this text to be aligned horizontally in all of the equations in the document. Example:

\documentclass{article}
\thispagestyle{empty}
\usepackage{amsmath}
\begin{document}
\begin{equation*}
  a_i + b_i = c_i
  \qquad \text{for i = 2, \dots, 9}
\end{equation*}
Then a lot of text follows.
\begin{equation}
  k_i = a_i + b_i + \sqrt{\text{some stuff that messes up alignment}}
  \qquad \text{for i = 1, \dots, 7}
\end{equation}
\end{document}

where I would like the for to be aligned.

0

This solution centers the first equation in the space taken by the second equation.

\documentclass{article}
\thispagestyle{empty}
\usepackage{mathtools}
\newsavebox{\tempbox}
\begin{document}
\savebox{\tempbox}{$\displaystyle k_i = a_i + b_i + \sqrt{\text{some stuff that messes up alignment}}$}
\begin{align}
  \mathmakebox[\wd\tempbox][c]{a_i + b_i = c_i}
  \qquad &\text{for i = 2, \dots, 9} \notag
\intertext{Then a lot of text follows.}
  \usebox{\tempbox}
  \qquad &\text{for i = 1, \dots, 7}
\end{align}
\end{document}

demo

1

enter image description here

\documentclass{article}
\thispagestyle{empty}
\usepackage{amsmath}
\begin{document}
\begin{align*}
  a_i + b_i &= c_i
  &\qquad \text{for }i = 2, \dots, 9\\% math mode here!!!!
\intertext{
Then a lot of text follows.
\endgraf
and more
\endgraf
a third paragraph
}
  k_i &= a_i + b_i + \sqrt{\text{some stuff that messes up alignment}}
  &\qquad \text{for } i = 1, \dots, 7% math mode here!!!!
\end{align*}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.