I would like to format a paragraph of text such that the width of the paragraph shrinks until the last line in the paragraph is about the same width as all the others.
Here is an example of what I mean in CSS/javascript.
In LaTeX, consider this document:
\documentclass{article}
\begin{document}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam justo sem,
malesuada ut ultricies ac.
\end{document}
For me, this produces two lines with the break after "sem,", such that the second line is significantly shorter than the first:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam justo sem,
malesuada ut ultricies ac.
What I want instead is something like this (although the exact position of the line break would depend on the font):
Lorem ipsum dolor sit amet, consectetur adipiscing
elit. Nam justo sem, malesuada ut ultricies ac.
Any direction would be appreciated, because I've been unable to make any headway searching on my own. I know I could use \parbox
or \minipage
to make paragraphs of a fixed width, but this needs to be a dynamic width.