如何填充段落的最后一行而不是第一行

如何填充段落的最后一行而不是第一行

我有一个右对齐的 parbox。当单词未填满整行时,最后一行是不完整的:

\documentclass[preview]{standalone}

\begin{document}

\fbox{\parbox{10cm}{\raggedleft Some text some text some text some text some text}}

\fbox{\parbox{10cm}{\raggedleft Some text some text some text  some text some text some text some text some text some text}}

\end{document}

我可以做什么

相反,我希望最后一行是完整的,而第一行不完整

我想做什么

当然,我可以使用 手动完成\linebreak,但是 LaTeX 可以自动完成吗?

答案1

在此处输入图片描述

\documentclass[preview]{standalone}

\begin{document}

\fbox{\parbox{10cm}{\raggedleft Some text some text some text some text some text}}

\fbox{\parbox{10cm}{\raggedleft Some text some text some text  some text some text some text some text some text some text}}


\fbox{\parbox{10cm}{\raggedleft
\parfillskip-\leftskip\hfill
Some text some text some text  some text some text some text some text some text some text}}

\end{document}

相关内容