Open main menu

Changes

Initial version
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
xxxxxxxxxxxxxxxx
xxxx
xxxxxxxxxxxxxx
xxxxxxxxxxxxxxxx

2. the last line should be shorter than block width
xxxxxxxxxxxxxxxx
xxxxxxxxxxxxxx
xxxxxxxxxxxxxx
xxxxxxxxxxxxxxxx

It can be achieved by custom settings of {{cmd|parfillskip}} command.
https://www.tug.org/utilities/plain/cseq.html#parfillskip-rp

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

However, in case of unfavourable conditions the result can still yield to the length outside the allowed range<ref>Even if the second parameter is properly calculated, thanks to internal TeX processing the larger value may be used at the end.</ref>, as can be seen on several pages in the following example. So this approach should never been taken as a universal solution.

<texcode>
\setupindenting[yes, 2em]
\setuptolerance[strict]

\newdimen\lastlineminlength
\newdimen\lastlinemingap

\lastlineminlength=3em
\lastlinemingap=1em

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

\edef\ward{\cldloadfile{ward}}

\starttext

\dorecurse{100}{
\hsize\dimexpr\textwidth-#1mm\relax
\ward{}okey \par
\ward{}okey \par
\page
}

\stoptext
</texcode>

__________
<references/>