From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/101277 Path: news.gmane.org!.POSTED!not-for-mail From: Joseph Canedo Newsgroups: gmane.comp.tex.context Subject: Re: Issues with vertical spacing in simple case Date: Thu, 19 Jul 2018 08:55:49 +0200 Message-ID: <5b5035f3.1c69fb81.3114a.6c6c@mx.google.com> References: <5b4e6111.1c69fb81.e885b.8caf@mx.google.com> <33c6d509-cb3b-eb28-8173-69114558ec95@xs4all.nl> <5b4fa427.1c69fb81.f14db.41eb@mx.google.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1132069263952406991==" X-Trace: blaine.gmane.org 1531983286 31594 195.159.176.226 (19 Jul 2018 06:54:46 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 19 Jul 2018 06:54:46 +0000 (UTC) To: Hans Hagen , mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Jul 19 08:54:42 2018 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fg2pj-00085g-8n for gctc-ntg-context-518@m.gmane.org; Thu, 19 Jul 2018 08:54:39 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 5F28D44AE9; Thu, 19 Jul 2018 08:56:01 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id W10gGWrZ56id; Thu, 19 Jul 2018 08:56:00 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id 368B244AE0; Thu, 19 Jul 2018 08:56:00 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 73DD244AE0 for ; Thu, 19 Jul 2018 08:55:59 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OGgWZkbqbIqS for ; Thu, 19 Jul 2018 08:55:58 +0200 (CEST) Original-Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id B7B9244ADF for ; Thu, 19 Jul 2018 08:55:48 +0200 (CEST) Original-Received: by mail-wr1-f51.google.com with SMTP id g6-v6so6894468wrp.0 for ; Wed, 18 Jul 2018 23:55:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:mime-version:to:from:subject:date:importance:in-reply-to :references; bh=akC3uho66XnQCXzDVQkXJWTINCHwojmQXBO9epPhwW0=; b=WnhDMOuCL3VJXUUzqf6pTuFFd/G/2BbxZvVBBqXXl4r1mRHUuYAQp2F30GyDz15yt6 jsgtrErxktIY6hwQ3lajx8oS1JGvR2H5NI34V4AiDNxekmlCEV7XU36uLvPE/0u17RQY zHKa1iURqkQmWgDimt5cD+WlfPpYE/H0F9YXNJCZjsz+o14+Lrlecm943qXP73paLBOq hCkuxVlxQ9eE5P9jSf8VpRbY5Nc+97Rmd4lXnYfocGuRplwRt5gNT0kuhqrz41csevNl NyMeQuqwbskhf4kzbKM1TNaEx0NKGN0Qv/Dj+6cBHwcK1fG1pjzqaOLD18EkVzm3InMg y3xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:mime-version:to:from:subject:date :importance:in-reply-to:references; bh=akC3uho66XnQCXzDVQkXJWTINCHwojmQXBO9epPhwW0=; b=A0rMiXggvydfLKyiCPp4K1yADgQURcqR2c0LcwD7roTPw6n+rYsYwGqpjnh+nJCWyl mCqlXqUKWPqbhp6D729w2knXaZOBlguHrLAVzZbO3xwDHm07W+ygjt5E1VR5v3uPA5ZS toK7dSSLJAD69aJ8SU/iqrk5MW+xnRy64y3DcP1512L1MeSI4ly8hp1qvk7Qzqfl0+I5 XBKBz8TjNB6DtlM73zc6xrsfiZoy0i6kxw9dxrNPn0l11/8q7vPUtSmV3kdZ5+QHoTVz sF7r44QMhqbzTEaCACanH0v3xFPnw49i+iXgfpKpWB4Re3V6GQB+HDgp1wgBlW5dtzKm sB/A== X-Gm-Message-State: AOUpUlGB22gEOtE0RpFx4niiYnU5hmahcCoYXhmkDPJaZ3WuDw4yuevP czWgCwAZYWHQiYMt0VoTyO+3EruL X-Google-Smtp-Source: AAOMgpcOLB/4hkOaNpMBNOvVVsU14cOZfkYIexT9RewxbPjs0vdmciV3MfrMu3JSEEcMupmfl4H70A== X-Received: by 2002:a5d:4210:: with SMTP id n16-v6mr6112989wrq.55.1531983348393; Wed, 18 Jul 2018 23:55:48 -0700 (PDT) Original-Received: from ?IPv6:2a01:cb00:68e:300:b5aa:1982:644e:3601? (2a01cb00068e0300b5aa1982644e3601.ipv6.abo.wanadoo.fr. [2a01:cb00:68e:300:b5aa:1982:644e:3601]) by smtp.gmail.com with ESMTPSA id x184-v6sm4069835wmg.24.2018.07.18.23.55.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Jul 2018 23:55:47 -0700 (PDT) Importance: normal X-Priority: 3 In-Reply-To: X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.org gmane.comp.tex.context:101277 Archived-At: --===============1132069263952406991== Content-Type: multipart/alternative; boundary="_20DD335F-2091-44E0-A917-6D803B333E88_" --_20DD335F-2091-44E0-A917-6D803B333E88_ Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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=E2=80=99s for clarity).=20 I am trying to create a MWE but it=E2=80=99s not trivial. The situation as = far as I understand it is like the following=C2=A0: I=E2=80=99ve added tracers for vspacing.synchronizepage function. When page 1 ships, there are 2 paragraphs (1 + 3 lines) still pending becau= se they do not fit in page 1 so they will be shipped in page 2 (I think tha= t what is in texlists.page_head variable). Hence tex.prevgraf which was 0 i= s set to 4 (see this from traces in output log). vspacing > page 4, prevdepth 2.56577pt =3D> 2.56577pt, prevgraf 0 = =3D> 4 vspacing > list glue:topskip hlist:line penalty:userpenalty penalty:= userpenalty glue:baselineskip hlist:line penalty:linebreakpenalty glue:base= lineskip hlist:line penalty:linebreakpenalty glue:baselineskip hlist:line g= lue:userskip Next paragraph after the 2 pending pars I refer to above has a non zero \ha= ngindent 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 han= ging (that=E2=80=99s 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 actu= ality it has 0. If I read correctly the TeXBook, prevgraf value has some im= pact on \hangafter / \hangindent The value of \prevgraf affects line breaking only when TEX is dealing with nonstandard \parshape or \hangindent. Joseph De=C2=A0: Hans Hagen Envoy=C3=A9 le=C2=A0:jeudi 19 juillet 2018 00:00 =C3=80=C2=A0: Joseph Canedo; mailing list for ConTeXt users Objet=C2=A0:Re: [NTG-context] Issues with vertical spacing in simple case On 7/18/2018 10:33 PM, Joseph Canedo wrote: > Thanks Hans. >=20 > Picked up today beta and some code I have relying on value of=20 > tex.prevgraf starts breaking. This is lettrine related code that sets=20 > hangafter for 1st paragraph and eventually subsequent if lettrine is=20 > larger than 1st par. >=20 > I see the function vspacing.synchronizepage() sets prevgraf value I=20 > guess to avoid bleeding also paragraph lines. >=20 > Is there any possibility to get original unchanged tex.prevgraf value,=20 > possibly using some callback or some other tex.=C2=A0? you cannot rely on prevgraf crossing pages (so you get e.g. 8 at the top=20 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 ----------------------------------------------------------------- --_20DD335F-2091-44E0-A917-6D803B333E88_ Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset="utf-8"

Thanks.

The pr= oblem 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 ac= tual page numbers, but it=E2=80=99s for clarity).

=  

I am trying to create a MWE but i= t=E2=80=99s not trivial. The situation as far as I understand it is like th= e following :

 

I=E2=80=99ve added tracers for vspacing.synchronizepage function.=

When page 1 ships, there are 2 paragraphs (1 + 3 l= ines) still pending because they do not fit in page 1 so they will be shipp= ed in page 2 (I think that what is in texlists.page_head variable). Hence t= ex.prevgraf which was 0 is set to 4 (see this from traces in output log).

 

vspacing= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 > page 4, prevdepth 2.56577pt= =3D> 2.56577pt, prevgraf 0 =3D> 4

vspacing= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 > list glue:topskip hlist:lin= e penalty:userpenalty penalty:userpenalty glue:baselineskip hlist:line pena= lty:linebreakpenalty glue:baselineskip hlist:line penalty:linebreakpenalty = glue:baselineskip hlist:line glue:userskip

&nb= sp;

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

 

The va= lue of \prevgraf affects line breaking only when TEX

is dealing with nonstandard \parshape or \hangindent.

 

Joseph=

 

<= b>De : Hans Hagen
E= nvoy=C3=A9 le :jeudi 19 juillet 2018 00:00
=C3=80 : Joseph Canedo; mailing list for ConTeXt users
Objet&nbs= p;:Re: [NTG-context] Issues with vertical spacing in simple case

 

On 7/18/2= 018 10:33 PM, Joseph Canedo wrote:

> Thanks Hans= .

>

> Picked up toda= y beta and some code I have relying on value of

&g= t; tex.prevgraf starts breaking. This is lettrine related code that sets

> hangafter for 1st paragraph and eventually subs= equent 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

 

--------------------= ---------------------------------------------

=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 Hans Hagen | PRAGMA ADE

= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 Ridderstraat 27 | 8061 GH Hasselt | The Netherlands

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 tel: 038 477 53 69 = | www.pragma-ade.nl | www.pragma-pod.nl

-----------= ------------------------------------------------------

 

= --_20DD335F-2091-44E0-A917-6D803B333E88_-- --===============1132069263952406991== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f --===============1132069263952406991==--