TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to format a list of steps to solve a quadratic equation. I have it so that it is aligning correctly for each of the math steps, but now I want to add some headings. This is what I have so far:

\noalign{\noindent some text in the middle.}\\\\  
(x - 1)(x - 3)&=&0\\\\  
\noalign{\noindent Solve Factor 1}\\\\  
x - 1&=&0\\\\  
+1& &+1\\\\  
\noalign{\noindent Solve Factor 2}\\\\  
x - 3&=&0\\\\  
+3& &+3\\\\  

The problems that I still have are: the noalign steps are still showing a lot of space around them. Also, is there a way to center the \noalign sections? Thanks!

share|improve this question
up vote 3 down vote accepted

Maybe something like this would look a bit better?


x^2-4x+3&= 0\\
\noalign{\centering some text in the middle.}
(x - 1)(x - 3)&= 0\\
\noalign{\centering Solve Factor 1}
x - 1&=0\\
+1& \pheq +1\\  
x&= 1\\  
\noalign{\centering Solve Factor 2}
x - 3&=0\\
+3&\pheq +3\\  
x&= 3  

I think you were overusing the &'s and the \\'s in your example. Note that the syntax for aligned (as well as align) is that of

x &= y

i.e. there is only one & right before the math relation. Since you also wanted to align, for example, the line +1 +1 which does not have an = sign in the middle, I defined a \pheq which works just like a = with respect to spacing, but does not show up in the document.

Also note that a single pair \\ is enough. If, for some reason, you want a bit more of space between the lines, use something like \\[5pt] instead of a double line break. Also note that there is no \\ right before closing the environment.

share|improve this answer
Thanks a lot for your help! The one issue I have remaining is that I would like to have the right side aligned to the right (like the left side is). Is there a way to do that? – Shane Fulmer Nov 18 '10 at 2:44

While I don’t think it is the most beautiful solution, replacing \noalign{\noindent some text in the middle.}\\ by \noalign{\centering some text in the middle.} (note the missing \\ at the end) solves the problem. I don’t know any simple way to improve the remaining spacing problems.

share|improve this answer

Your Answer


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.