General ⇒ "Aligning" the last line in a paragraph
"Aligning" the last line in a paragraph
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
"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
