ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Jan Tosovsky" <j.tosovsky@email.cz>
To: "'mailing list for ConTeXt users'" <ntg-context@ntg.nl>
Subject: Re: Length range control of the last line of paragraph
Date: Thu, 24 Mar 2016 20:36:48 +0100	[thread overview]
Message-ID: <12125.9355139502$1458848273@news.gmane.org> (raw)
In-Reply-To: <56F324EC.1010101@wxs.nl>

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?

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

\showmakeup

\starttext

\setupindenting[yes, 30pt]

\edef\ward{\cldloadfile{ward}}

%\setupalign[verytolerant,stretch]

\dorecurse{100}{
     \hsize\dimexpr\textwidth-#1mm\relax
     \dimen0=\dimexpr\availablehsize-3\parindent
     \advance\dimen0 by -\parindent

     \parfillskip \zeropoint plus \dimen0
     \ward\hbox to 10pt{}

     \ward\hbox to 10pt{}

     \startnarrower[left]
        \parfillskip \zeropoint plus \dimen0
        \ward\hbox to 10pt{}

        \parfillskip \zeropoint plus \dimen0
        \ward\hbox to 10pt{}

     \stopnarrower

     \page
}

\stoptext

Any idea?

___________________________________________________________________________________
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	other threads:[~2016-03-24 19:36 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <016501d183a5$d3c48810$7b4d9830$@tosovsky@email.cz>
2016-03-21 23:51 ` Rogers, Michael K
2016-03-22 20:29   ` Jan Tosovsky
     [not found]   ` <01b001d18479$93c9f310$bb5dd930$@tosovsky@email.cz>
2016-03-22 20:44     ` Hans Hagen
2016-03-22 10:16 ` Hans Hagen
2016-03-22 20:57   ` Jan Tosovsky
     [not found]   ` <01b401d1847d$798a9a00$6c9fce00$@tosovsky@email.cz>
2016-03-22 21:46     ` Hans Hagen
2016-03-23 19:14       ` Jan Tosovsky
     [not found]       ` <018a01d18538$3f17eb50$bd47c1f0$@tosovsky@email.cz>
2016-03-23 23:21         ` Hans Hagen
2016-03-24 19:36           ` Jan Tosovsky [this message]
     [not found]           ` <02cd01d18604$82a81620$87f84260$@tosovsky@email.cz>
2016-03-24 20:54             ` Hans Hagen
2016-03-25 13:40               ` Jan Tosovsky
     [not found]               ` <008a01d1869b$e0b90610$a22b1230$@tosovsky@email.cz>
2016-03-25 14:09                 ` Hans Hagen
2016-03-25 21:57                   ` Jan Tosovsky
     [not found]                   ` <00dd01d186e1$656dbff0$30493fd0$@tosovsky@email.cz>
2016-03-26 10:48                     ` Hans Hagen
2016-03-26 13:31                       ` Jan Tosovsky
     [not found]                       ` <003f01d18763$c77c4fe0$5674efa0$@tosovsky@email.cz>
2016-03-26 22:05                         ` Hans Hagen
2016-03-30 19:23                       ` Jan Tosovsky
     [not found]                       ` <017b01d18ab9$99df34e0$cd9d9ea0$@tosovsky@email.cz>
2016-03-30 22:11                         ` Hans Hagen
2016-03-25 16:56                 ` Hans Hagen
2016-03-22 10:54 ` Hans Hagen
2016-03-22 13:31   ` Hans Hagen
2016-03-23 19:47     ` Jan Tosovsky
2016-03-24  2:10     ` Aditya Mahajan
2016-03-24  9:47       ` Hans Hagen
2016-03-23 19:14   ` Jan Tosovsky
     [not found]   ` <018901d18538$3ef34c50$bcd9e4f0$@tosovsky@email.cz>
2016-03-23 23:22     ` Hans Hagen
2016-03-21 19:14 Jan Tosovsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='12125.9355139502$1458848273@news.gmane.org' \
    --to=j.tosovsky@email.cz \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).