1

Googling around has not produced an answer to this, possibly because of the complexity of the question doesn't lend itself to easy googling. What I want to be able to do is control how white space appears in the output document. In the tex document, I might have two paragraphs as

Text in paragraph one.
Text in paragraph two.

And in the output they appear as two separate paragraphs, which is good. But in the tex document, it looks very jumbled and hard to read. However, if I attempt to make it a bit easier to read by doing

Text in paragraph one.

Text in paragraph two.

suddenly latex thinks I want extra space between the paragraphs and the output document has extra, unnecessary space. Is there a way I can include this extra space in the tex document for clarity and organization and not have it appear in the output? It gets really ugly when I have stuff that looks like

\documentclass[12pt, letterpaper]{letter}

\begin{document}

Paragraph one.
\begin{equation}
equation one
\end{equation}
\begin{equation}
equation two
\end{equation}
Paragraph two.

\end{document}

and I would much rather see

\documentclass[12pt, letterpaper]{letter}

\begin{document}

Paragraph one.

\begin{equation}
equation one
\end{equation}

\begin{equation}
equation two
\end{equation}

Paragraph two.

\end{document}
  • Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – user31729 Apr 26 '14 at 17:23
  • 1
    Empty line means New paragraph. Don't leave blank lines before nor after equation. If you want, start it with % to better format. – Sigur Apr 26 '14 at 17:25
  • The issue is that I don't want blank lines to create new paragraphs. Without blank lines the tex looks muddled and hard to read. I suppose I could put blank lines with nothing but a comment symbol. That doesn't do exactly what I wanted, but it does help make it a bit clearer. – whiteknight Apr 26 '14 at 17:29
  • 3
    blank lines are changed into \par in the very core of tex, that behaviour is not at the macro layer or in any user configurable part. the only way to stop it is to change the catcode of the end of line character (which will break most things) – David Carlisle Apr 26 '14 at 17:37
  • 1
    I don't understand your initial example with two lines. With no blank line they will be set as part of the same paragraph yet you seem to indicate the second line is paragraph 2? – David Carlisle Apr 26 '14 at 17:38
3

A blank line in TeX is not white space that may be used to pretty print the source: it is an instruction equivalent to \par that ends the current paragraph. It's possible not to like that syntax but it is just the way TeX is, similar to (but in fact more primitive than) using {} for arguments or \ to introduce a command name.

If I take your example but use article rather than letter as it makes paragraph breaks more obvious (as they are indented) then you see in

\documentclass[12pt, letterpaper]{article}

\begin{document}

Paragraph one.
\begin{equation}
equation one
\end{equation}
\begin{equation}
equation two
\end{equation}
Paragraph two.

\end{document}

Your Paragraph two. is not the start of a second paragraph, it is a continuation of the first, which is why it is flush left rather than being indented. enter image description here

If you want to start a paragraph after the equation then you require a blank line:

\documentclass[12pt, letterpaper]{article}

\begin{document}


Paragraph one.
\begin{equation}
equation one
\end{equation}
\begin{equation}
equation two
\end{equation}

Paragraph two.

\end{document}

enter image description here

Conversely a blank line before an equation is just an error and it makes an entirely spurious "white" line before the equation.

\documentclass[12pt, letterpaper]{article}

\begin{document}


Paragraph one.

\begin{equation}
equation one
\end{equation}
\begin{equation}
equation two
\end{equation}
Paragraph two.

\end{document}

enter image description here

Note the extra white space after Paragraph one here is not vertical space (and does not stretch, and is not discarded at a page break) it is a spurious extra paragraph with just a line consisting of indentation box and parfillskip glue, and no text.

0

Two strategies spring to mind: firstly it might help to make greater use of indentation to help make your tex file more readable, and secondly consider staying your empty lines with a percent sign to comment them out. That should still provide the helpful spacing but LaTeX won't interpret them as paragraph breaks.

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.