On 3/21/2016 8:14 PM, Jan Tosovsky wrote:
Dear All,

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

(1) the last line lenght is greater than the left indent
     xxxxxxxxxxxxxxxx
     xxxx
       xxxxxxxxxxxxxx
     xxxxxxxxxxxxxxxx

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


you need to keep in mind that what would work out well for one specific case will not look nice in general as the last line filling is just one of the aspects ... so, your last line + following first line might look okay (according to whatever rules and criteria) but then, as you also need to increase the tolerance and enable stretch to permit that solution to be found, the rest might look like crap

it's the same for successive hyphenation and club/widow: any whole document setting that is done to get rid of one or two odd cases will often make the rest of the text look bad

this is a side effect of focusing on a specific typographical aspect whereby ignoring the rest combined with fully automated typesetting

of course one can have extensive discussions about how things should look right but one cannot ignore the text itself then: adding a few words or rephrasing is often a better way out

(the same applies to fonts: one can stress the virtues of some advanced kerning between two glyphs but at the same time be blind for the cases where it doesn't happen)

(ad 1) Some suggestions can be found in
http://tex.stackexchange.com/questions/28357/ensure-minimal-length-of-last-l
ine - but to be honest, it is not very clear to me how to apply it and even
combine with (2)

(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)

I'd be grateful for any command which would set this globally for all
paragraphs. Partly requested here  http://tracker.luatex.org/view.php?id=885

One could set
(a) minimum length - default=2*indent
(b) minimum gap - default=indent
(c) minimum block width where (a) and (b) are still to be applied -
default=2*a+b

any heuristic that works for one case will make another worse (when applied to a whole document)

(ad c) if there are narrower blocks within the document (e.g. blockquotes),
we should still have some room for typesetting the last line content. If the
area width is insufficient, the last line would be typeset without these
(a+b) restrictions.

In meantime, any suggestion how to combine a+b manually are welcome.

it's hard to envision an interface, maybe some extra key in setupalign

\setupindenting[big] \indenting[yes]

\edef\ward{\cldloadfile{ward}}

\setupalign[verytolerant,stretch]

\dorecurse{100}{
    \hsize\dimexpr\textwidth-#1mm\relax
    \parfillskip \zeropoint plus 1fil\relax
    \ward  \par
    \parfillskip \zeropoint plus \dimexpr\availablehsize-3\parindent\relax
    \ward  \par
    \startnarrower[left]
        \parfillskip \zeropoint plus 1fil\relax
        \ward \par
    \stopnarrower
    \startnarrower[left]
\parfillskip \zeropoint plus \dimexpr\availablehsize-3\parindent\relax
        \ward \par
    \stopnarrower
    \page
}

The 2*indent is not enough in most cases.

Actually, in context another mechanism can help:

\definehyphenationfeatures
  [words]
  [rightwords=3,
   lefthyphenmin=4,
   righthyphenmin=4]

\enabletrackers[hyphenator.visualize]

\setupalign[verytolerant,stretch]

\dontcomplain

\sethyphenationfeatures
  [words]

\setuphyphenation
  [method=traditional]

\dorecurse{100}{\hsize\dimexpr\textwidth-#1mm\relax \input tufte \page}

\stoptext

currently this doesn't discourage breaks between the last words but i'll add an option for that (chars or words in that case, that is the question) ... the reason for this mechanism is not so much the length but more the fact that one doesn't want an (even long) last word hyphenated.

Hans

-----------------------------------------------------------------
                                          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