ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Joseph Canedo <josephcanedo@gmail.com>
To: Hans Hagen <j.hagen@xs4all.nl>,
	 mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Issues with vertical spacing in simple case
Date: Thu, 19 Jul 2018 08:55:49 +0200	[thread overview]
Message-ID: <5b5035f3.1c69fb81.3114a.6c6c@mx.google.com> (raw)
In-Reply-To: <ee913d43-2b66-0f0a-bb5b-a82e3344c479@xs4all.nl>


[-- Attachment #1.1: Type: text/plain, Size: 2828 bytes --]

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

Joseph

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

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


[-- Attachment #1.2: Type: text/html, Size: 5677 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 bytes --]

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2018-07-19  6:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-17 21:35 Joseph Canedo
2018-07-17 22:03 ` Hans Hagen
2018-07-18  9:10 ` Hans Hagen
2018-07-18 20:33   ` Joseph Canedo
2018-07-18 22:00     ` Hans Hagen
2018-07-19  6:55       ` Joseph Canedo [this message]
2018-07-19  7:35         ` Hans Hagen
2018-07-19 20:26           ` Joseph Canedo
2018-07-19 20:52             ` Joseph Canedo
2018-07-20  8:51               ` Hans Hagen
2018-07-20 22:01                 ` Joseph Canedo
2018-07-26 20:57                   ` Joseph Canedo

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=5b5035f3.1c69fb81.3114a.6c6c@mx.google.com \
    --to=josephcanedo@gmail.com \
    --cc=j.hagen@xs4all.nl \
    --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).