5

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?

2

1 Answer 1

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:

enter image description here

If you want right alignement for the last line, change

\parfillskip=0cm plus 1fil

to

\parfillskip=0cm plus 0.5fil

enter image description here

1
  • 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, 2016 at 10:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .