Paragraph last line control

From Wiki
Jump to navigation Jump to search

In case of separating paragraphs by indenting the first line (instead of blank line), it allows influencing a minimum and maximum length of the last line. The former prevents gaps between the end of the line and next indented line. The latter avoids cases the last line ends at the rigth edge so the next paragraph has no clear distincion from the previous one.

1. the last line lenght should be greater than the left indent


2. the last line should be shorter than block width


It can be achieved by custom settings of \parfillskip command.

The first parameter is a minimal right indent which can eventually be enlarged by the value of the second parameter: \parfillskip <right-indent> plus <tolerance>

However, in case of unfavourable conditions the result can still yield to the length outside the allowed range[1], as can be seen on several pages in the following example. So this approach should never been taken as a universal solution.

\setupindenting[yes, 2em]



\parfillskip \lastlinemingap plus \dimexpr\availablehsize-\lastlineminlength-\lastlinemingap\relax



   \ward{}okey \par
   \ward{}okey \par



  1. Even if the second parameter is properly calculated, thanks to internal TeX processing the larger value may be used at the end.