General ⇒ "Aligning" the last line in a paragraph
"Aligning" the last line in a paragraph
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
"Aligning" the last line in a paragraph
Code: Select all
\documentclass{article}
\usepackage{lipsum}
% This is the relevant environment
\newenvironment{LastLineToRight}%
{\setlength{\parindent}{0pt}\setlength{\leftskip}{0pt plus 1fil}\setlength{\rightskip}{0pt plus -1fil}}{\par}
% \parskip increased to better see the end of each paragraph
\addtolength{\parskip}{3ex}
\begin{document}
% Two paragraphs with normal text
\lipsum[1-2]
% Paragraphs with the last line right justified.
\begin{LastLineToRight}
\lipsum[1-20]
\end{LastLineToRight}
% Normal text again
\lipsum[1-2]
\end{document}
Re: "Aligning" the last line in a paragraph

"Aligning" the last line in a paragraph
Code: Select all
\newenvironment{LastLineCentered}%
{\setlength{\parindent}{0pt}\setlength{\leftskip}{0pt plus 0.5fil}\setlength{\rightskip}{0pt plus -0.5fil}}{\par}
Re: "Aligning" the last line in a paragraph
