# Is it possible to force LaTeX to stretch the last line in a paragraph to fill the complete line?

Force the word triangle to connect with the page frame, and adding even spacing between the words to make it fit nicely.

Put the first paragraph in its own box, and use \parfillskip to make the last line completely full.

\documentclass[12pt, a4paper]{article}

\begin{document}

\section{The Koch snowflake}

\parbox{\textwidth}{The \emph{Koch snowflake}, one of the first fractals,
is based on the work by the Swedish mathematician Helge von Koch [1]. It is
what we get if we start with an equilateral triangle \parfillskip=0pt}

\begin{figure}[ht]
\centering some pretty pictures here
\end{figure}

Some more text.

\end{document}


In fact the \parbox isn't essential, but a solution without it almost as much typing - you have to put the paragraph in a group of its own to stop the \parfillskip leaking into the rest of the document, and explicitly end the paragraph with \parbefore the end of the group - but that might be useful to someone who wants to put this in a macro definition.

{The \emph{Koch snowflake}, one of the first fractals,
is based on the work by the Swedish mathematician Helge von Koch [1]. It is
what we get if we start with an equilateral triangle \parfillskip=0pt\par}


Note, I turned your example into a minimum working example - mainly because I don't like being a copy-typist! In future, please copy-and-paste your code into the question, so we can copy-paste-and-edit it in an answer!

• It actually suffices to do ... triangle{\parfillskip=0pt\par}. Starting a paragraph inside a group is dangerous as it scopes the effect of \everypar. This breaks , e.g., wrapfig. – Henri Menke Sep 12 '17 at 4:16
• note the vertical space is better without the parbox. You have used a vertically centred box, so the baselines of the first and last lines can not be "seen" which affects both the space after the section heading and the space following the paragraph. Also of course it prevents page breaking within the paragraph (in general, although latex wouldn't allow a page break in a two line paragraph after a heading) – David Carlisle Sep 12 '17 at 8:07