# Line-Breaking Around \clearpage

AFAIK, line-breaking around \begin{document}, \end{document}, or \begin{section} doesn't change the results as follows.

\documentclass{article}
% INSERTING OR DELETING THIS LINE DOESN'T AFFECT THE OUTCOME
\begin{document}
% INSERTING OR DELETING THIS LINE DOESN'T AFFECT THE OUTCOME
Hello, world!
% INSERTING OR DELETING THIS LINE DOESN'T AFFECT THE OUTCOME
\end{document}


I wonder if this is the same for \clearpage. I think there are seven possible spots for \clearpage that seemingly produce the same output. Do they have no logical difference from one another?

Spot 1: The spot right after the first paragraph.

\documentclass{article}
\begin{document}
This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence.\clearpage

This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence.
\end{document}


Spot 2: The spot right below the first paragraph.

\documentclass{article}
\begin{document}
This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence.
\clearpage

This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence.
\end{document}


Spot 3: Two lines away from both the first and second paragraphs.

\documentclass{article}
\begin{document}
This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence.

\clearpage

This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence.
\end{document}


Spot 4: The spot right above the second paragraph.

\documentclass{article}
\begin{document}
This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence.

\clearpage
This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence.
\end{document}


Spot 5: The spot right before the second paragraph.

\documentclass{article}
\begin{document}
This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence.

\clearpage This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence.
\end{document}


Spot 6: In the middle of the two paragraphs with no additional line break.

\documentclass{article}
\begin{document}
This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence.
\clearpage
This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence.
\end{document}


Spot 7: Just at the beginning of the second paragraph with no line break.

\documentclass{article}
\begin{document}
This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence.
\clearpage This is a sentence. This is a sentence. This is a sentence. This is a sentence. This is a sentence.
\end{document}


I think either Spot 1 or Spot 3 is more readable than others, and Spot 7 is the shortest code among all the candidates with the same outcome. I wonder if pursuing easy-reading (or space-saving sometimes) coding practice unexpectedly influences the results.

• Why should there be a difference? I don't think there is. LaTeX puts every paragraph in a box, then typesets the boxes vertically one after the other. \clearpage creates a new page in which the next box will be printed, the spaces don't matter much. I would use 1 or 3 for readability, but really, it's up to you. Oct 12, 2020 at 8:35
• @EladDen paragraphs are not boxed: (try your reasoning with \pagebreak instead of \clearpage :-) Oct 12, 2020 at 8:55

Unlike \pagebreak, \clearpage (via \newpage) inserts a \par before processing, and after processing is consequently already in vertical mode. this means that putting a blank line (\par) before or after makes no difference. However a blank line is the standard document markup for paragraph breaks so I would always add a blank line between paragraphs (doesn't really matter whether that is before or after the clearpage) rather than rely on the technical detail that \clearpage ends the current paragraph.
If you try your examples with \pagebreak instead of \clearpage you will see a big difference between the cases with the versions with no blank line being set as a single paragraph, not two.