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?

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

  • 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

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.