0

enter image description here

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

2

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

\documentclass[12pt, a4paper]{article}
\usepackage[a4paper, includeheadfoot, margin=2.54cm]{geometry}

\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!

  • 3
    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

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.