The left part of the attached figure showes the nomal typeset of \parbox. The first/second lines are fully filled with words, and the rest words are bent to the third line. What interests me is: how to justify words of the last line autometically as shown on the right part of the attatched figure? Briefly speaking, add a option arg [s] to \parbox just like the \makebox does.


\parbox[s]{15em}{How to spread align the rest words which are not enough to fill the width of parbox?}% I just want the option arg of \parbox in this example works like \makebox[s] does.



1 Answer 1


There is nothing special about \parbox here, you see the same paragraph justification in the main page, normally the last line is allowed to be short but if you want that space to be 0pt you can set


As this makes it much harder to get a reasonable paragraph setting you probably should also use \sloppy to allow other spaces to stretch more to compensate.

enter image description here


How to spread align the rest words which are not
  enough to fill the width of

  • Sorry David, I don't quite understand your meaning. Would you please send a MWE illustrated how to get to the typeset I want? Thank you.
    – lyl
    Feb 17, 2019 at 9:41
  • @lyl example added Feb 17, 2019 at 9:46
  • Great trick!! That's just what I nedd!! Many thanks! And where can I find descriptions about \sloppy and \parfillskip, because I don't konw how to use them?
    – lyl
    Feb 17, 2019 at 9:52
  • @lyl \parfillskip is a tex primitive so the texbook or the free texbytopic, \sloppy should be in any basic latex tutorial, but offical documentation is the latex book, there are thousands of examples of both on this site Feb 17, 2019 at 9:54
  • After the use of \setlength\parfillskip{0pt} in \parbox, will it affect folloing paragraph ?
    – lyl
    Feb 17, 2019 at 10:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .