Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm often finding I need to lay out an equation in a manner resembling the following source:

\begin{align*}
    x = y + z
\end{align*}
where $y = $ the value of $y$;
      $z = $ the value of $z$.

Of course, that precise code puts all the "where" definitions on the one line, as parts of the same paragraph. What would be the best way to specify that list, such that it appears similarly to that above source, i.e., like this?

      x = y + z
where y = the value of y;
      z = the value of z.

Preferably, the equals signs in the list would be aligned with the one in the actual equation.

share|improve this question
    
I've added mathtools's \shortintertext as a slightly condensed alternative. –  Werner Feb 27 '12 at 18:39
add comment

1 Answer

up vote 10 down vote accepted

You can use amsmath's \intertext macro to intersperse regular paragraph-aligned text within an align environment:

enter image description here

\documentclass{article}
\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\begin{document}
From this, it is easy to see that
\begin{align*}
    x &= y + z \\
\intertext{where}
    y &= \text{the value of $y$}; \\
    z &= \text{the value of $z$}.
\end{align*}
\end{document}

This maintains the original align alignment and doesn't require any fiddling with boxes (another way of making sure the alignment remains the same).


mathtools provides some extensions to amsmath functionality, including \shortintertext, yielding a slightly condensed display:

enter image description here

\documentclass{article}
% Automatically loaded by mathtools
%\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\usepackage{mathtools}% http://ctan.org/pkg/mathtools
\begin{document}
From this, it is easy to see that
\begin{align*}
    x &= y + z \\
\shortintertext{where}
    y &= \text{the value of $y$}; \\
    z &= \text{the value of $z$}.
\end{align*}
\end{document}
share|improve this answer
    
Addresses the issue perfectly. Thank you. –  00Davo Feb 27 '12 at 2:28
2  
There is also \shortintertext with the \mathtools package which produces tighter spacing. –  Peter Grill Feb 27 '12 at 16:49
    
@PeterGrill: Thanks - I've added a visual of the difference. –  Werner Feb 27 '12 at 18:38
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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