How can I get justified text, with the last line in each paragraph centered, or justified text with the last line flush right? Is there a typographic reason why I cannot find this setting?
Asked
Active
Viewed 395 times
5
-
here are two previous questions on the subject: How to center the last line of a paragraph? (r-to-l text); Center last line of the paragraph; but I don't like small lines. – barbara beeton Oct 30 '16 at 13:55
-
Those who are interested in non-typical paragraph shapes might be interested in two TUGboat articles, available as https://tug.org/TUGboat/tb28-2/tb89glister.pdf and https://tug.org/TUGboat/tb29-2/tb92glister.pdf – Peter Wilson Oct 30 '16 at 21:06
1 Answers
8
See subsection 18.3.1 of TeX by Topic.
The solution for a centered last line is to put the following lines in your document:
\leftskip=0cm plus 0.5fil \rightskip=0cm plus -0.5fil
\parfillskip=0cm plus 1fil
MWE:
\documentclass{article}
\usepackage{lipsum}
\leftskip=0cm plus 0.5fil \rightskip=0cm plus -0.5fil
\parfillskip=0cm plus 1fil
\begin{document}
\lipsum
\end{document}
Output:
If you want right alignement for the last line, change
\parfillskip=0cm plus 1fil
to
\parfillskip=0cm plus 0.5fil
karlkoeller
- 124,410
-
Thanks. I don't have time in the next week or two to review the code you've given me, but I'll accept your answer when I do. – ahorn Oct 31 '16 at 10:15

