On 3/24/2016 8:36 PM, Jan Tosovsky wrote:
On 2016-03-24 Hans Hagen wrote:
On 3/23/2016 8:14 PM, Jan Tosovsky wrote:
On 2016-03-22 Hans Hagen wrote:
On 3/22/2016 9:57 PM, Jan Tosovsky wrote:
On 2016-03-22 Hans Hagen wrote:
On 3/21/2016 8:14 PM, Jan Tosovsky wrote:

when paragraphs are separated by indenting the first line
(instead of an empty line), these rules should be followed:

(2) the last line is shorter than block width
        xxxxxxxxxxxxxxxx
        xxxxxxxxxxxxxx
          xxxxxxxxxxxxxx
        xxxxxxxxxxxxxxxx

(ad 2) This can be done using \parfillskip XXpt plus 1fil
(where XX is required gap)

setting the XXpt is tricky as it might lead to underful or
overful cases when that amount start interfering with an optimal
solution (as it's seen as acceptable overflow in some direction)

underful or overful where? in previous lines? I am quite lost here

\starttext

\setupalign[tolerant,stretch]
\dorecurse{100}{
       \hsize\dimexpr\textwidth-#1pt\relax
       \parfillskip -4em plus 1 fill
       \input tufte
       \page
}

\stoptext

page 43

In my output I can see overful of the last line on pages 38-46.

How can this happen? Isn't it a clear bug?

What exactly mean 'that amount start interfering with an optimal
solution'? Isn't parfillskip settings taken already into an
account when composing the paragraph?

it's just a skip added at the end of the line ... so like any skip
and if you give it a fill that will be taken into account in
linebreaks (just like other fill)

\starttext

\dorecurse{100}{testtesttesttesttest #1 \hskip0ptplus1fill\relax}

\stoptext


To be honest, I can't still decipher the reason why the line is not broken...

We basically need:
<text><glue min-width='XX' max-width='hsize-3*indent'>

and I thought this is exactly what \parfillskip ensures
\parfillskip XX plus (hsize - 3*indent)

Or is it impossible in TeX to achieve such rule?

the fil is taken into account when calculating the best break points and then the XX is fixed but plus/minus can lead to if being less or more, all relative to other fill (distributed)

so, XX plus (hsize - 3*indent) is not a fixed value, it's XX or more

take this:

\ruledhbox to 10cm {x\hskip0pt plus 1cm x}

the skip will stretch more than 1cm

\ruledhbox to 10cm {x\hskip0pt plus 1cm\relax x%
                    x\hskip0pt plus 2cm\relax x}

now the glue gets distributed 1:2, so now you can guess

\ruledhbox to 10cm {x\hskip1mm plus 1cm\relax x%
                    x\hskip8mm plus 2cm\relax x}

Are there other ways? I can think of:
<text><space width='XX'><glue min-width='0' max-width='hsize-3*indent-XX'>

But in this case that space at the end can be completely swallowed (by negative 
glue). I've tried it in the following example, but there is another problem 
from page 58 - blank line. But my TeX interpretation of the above pseudo code 
may be inappropriate...

you can see what glue eventually is used with:

\showmakeup[glue]

\start

\parfillskip  123pt           \relax \input tufte \par
\parfillskip  123pt plus 1fil \relax \input tufte \par
\parfillskip  123pt           \relax \input tufte \par
\parfillskip -123pt plus 1fil \relax \input tufte \par

\stop


-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to