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.

Possible Duplicate:
Blank lines in align environment

When I put a blank line between a line of text and the align environment, it will add two blank lines instead. It seems that the align environment automatically adds a set of blank lines. I don't want two sets of blank lines, but this makes my code very hard to read. Compare (the 'correct way')

\begin{align*}
L\frac{di}{dt} + Ri = EU(t) \\
i(0) = 0
\end{align*}
In Heaviside's operator notation, this is 
\begin{align*}
pLi + Ri &= EU(t)\\
i &= \frac{E}{pL + R}U(t)
\end{align*}

and

\begin{align*}
L\frac{di}{dt} + Ri = EU(t) \\
i(0) = 0
\end{align*}

In Heaviside's operator notation, this is 

\begin{align*}
pLi + Ri &= EU(t)\\
i &= \frac{E}{pL + R}U(t)
\end{align*}

This may seem trivial but in a large document it's really hard to read the first example and relatively easy to read the second.

Is there a way to change this, e.g. with a \renewcommand?

By the way, is there an easier way of putting code on this site besides hitting space bar 4 times for each line? I tried HTML tags but they don't work.

share|improve this question

marked as duplicate by Marco Daniel, Alan Munn, lockstep, Stefan Kottwitz Nov 26 '11 at 20:50

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2  
For readability of your source file, you can simply put a comment character (%) to separate the lines in your first example. For highlighting code in tex.sx posts, you can select all the code and then click on the {} icon. –  Alan Munn Nov 26 '11 at 20:28
    
The blank line tells TeX to start a new paragraph; the behaviour you are seeing is to be expected. You are not seeing two blank lines, but are seeing a paragraph skip. –  cmhughes Nov 26 '11 at 20:38

1 Answer 1

up vote 7 down vote accepted

Use the comment sign % instead of a blank line.

\begin{align*}
L\frac{di}{dt} + Ri = EU(t) \\
i(0) = 0
\end{align*}
%
In Heaviside's operator notation, this is 
%
\begin{align*}
pLi + Ri &= EU(t)\\
i &= \frac{E}{pL + R}U(t)
\end{align*}
share|improve this answer
    
Fantastic, this is a much better solution than I anticipated. –  xiongtx Nov 26 '11 at 20:43
    
This only removes the top line for me, not the bottom one. –  queueoverflow Dec 30 '11 at 19:35

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