Re: [NTG-context] Length range control of the last line of paragraph
On 3/26/2016 2:31 PM, Jan Tosovsky wrote:
On 2016-03-26 Hans Hagen wrote:
On 3/25/2016 10:57 PM, Jan Tosovsky wrote:
On 2016-03-25 Hans Hagen wrote:
On 3/25/2016 2:40 PM, Jan Tosovsky wrote:
On 2016-03-24 Hans Hagen wrote:
On 3/24/2016 8:36 PM, Jan Tosovsky wrote: > > 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) > 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
So the following \parfillskip specification finally seems to be what I was looking for ...
\parfillskip \lastlinemingap plus \dimexpr\availablehsize-\lastlineminlength-\lastlinemingap\relax
\parfillskip \lastlinemingap plus 1fill
works just as well
I am getting slightly different results on several pages. The number of problematic cases is lower in my variant so I hope it makes still sense.
try \ward{}okay i.e. a short word at the end
Hmm, I indeed tested my approach with bad example. Now your previous examples make more sense to me :-)
for your case i see no solution apart from heuristic lua magic
Bad news. But I hope my parfillskip will work for majority cases and these problematic with words shorter than parindent+tolerance can be fixed afterwards by joining them with previous words using non-breaking space.
that is what previously posted alternative hyphenater code does: making sure that there are some reasonable amount of characters / words
I'll look into your 'crap' paragraph builder lua code if this exception could be handled programmatically without touching the source file (i.e. test for short last line and treat leading whitespace as it was '~' if necessary).
Jan
___________________________________________________________________________________ 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 ___________________________________________________________________________________
participants (1)
-
Hans Hagen