[NTG-context] Issues with vertical spacing in simple case

Joseph Canedo josephcanedo at gmail.com
Thu Jul 19 08:55:49 CEST 2018

The problem happens in a case where there are no paragraph split between 2 pages. All pars are entirely either in page 1 or page 2 (these numbers are not actual page numbers, but it’s for clarity). 

I am trying to create a MWE but it’s not trivial. The situation as far as I understand it is like the following :

I’ve added tracers for vspacing.synchronizepage function.
When page 1 ships, there are 2 paragraphs (1 + 3 lines) still pending because they do not fit in page 1 so they will be shipped in page 2 (I think that what is in texlists.page_head variable). Hence tex.prevgraf which was 0 is set to 4 (see this from traces in output log).

vspacing        > page 4, prevdepth 2.56577pt => 2.56577pt, prevgraf 0 => 4
vspacing        > list glue:topskip hlist:line penalty:userpenalty penalty:userpenalty glue:baselineskip hlist:line penalty:linebreakpenalty glue:baselineskip hlist:line penalty:linebreakpenalty glue:baselineskip hlist:line glue:userskip

Next paragraph after the 2 pending pars I refer to above has a non zero \hangindent and \hangafter (set to -1) and when it starts being processed (in horizontal mode) prevgraf is already 4 so I think this cancels out that hanging (that’s the effect I see in output, there is no indent in 1st line of 3rd par), as IIRC TEX considers par has already 4 lines but in actuality it has 0. If I read correctly the TeXBook, prevgraf value has some impact on \hangafter / \hangindent

The value of \prevgraf affects line breaking only when TEX
is dealing with nonstandard \parshape or \hangindent.


De : Hans Hagen
Envoyé le :jeudi 19 juillet 2018 00:00
À : Joseph Canedo; mailing list for ConTeXt users
Objet :Re: [NTG-context] Issues with vertical spacing in simple case

On 7/18/2018 10:33 PM, Joseph Canedo wrote:
> Thanks Hans.
> Picked up today beta and some code I have relying on value of 
> tex.prevgraf starts breaking. This is lettrine related code that sets 
> hangafter for 1st paragraph and eventually subsequent if lettrine is 
> larger than 1st par.
> I see the function vspacing.synchronizepage() sets prevgraf value I 
> guess to avoid bleeding also paragraph lines.
> Is there any possibility to get original unchanged tex.prevgraf value, 
> possibly using some callback or some other tex.<Something> ?
you cannot rely on prevgraf crossing pages (so you get e.g. 8 at the top 
of a page with 5 lines

where/how does it fail


                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20180719/015af97a/attachment-0001.html>

More information about the ntg-context mailing list