Text Formatting ⇒ Force last line in paragraph to justify
Force last line in paragraph to justify
I am doing some micro-optimisations on my text/figure layout, and I want to insert figures and tables in the middle of paragraphs and have the text flow around them - Just the top and bottom, the figures are the full width of the text.
I would prefer to work with vanilla-LaTeX, and not have to use any external packages.
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Force last line in paragraph to justify
this can be achieved by adjusting the \leftskip, \rightskip and \parfillskip lengths:
Code: Select all
\documentclass{book}
\usepackage{lipsum}% just to generate some text
\setlength\leftskip{0pt plus 1fil}
\setlength\rightskip{-\leftskip}
\setlength\parfillskip{\leftskip}
\begin{document}
\lipsum[1-4]
\end{document}Edit: if you are planning to use these settings throughout your document, I would also suggest to use
Code: Select all
\setlength\parindent{0pt}