Received: from mail.proteosys.com ([62.225.9.49]) by nummer-3.proteosys with Microsoft SMTPSVC(5.0.2195.5329); Fri, 7 Mar 2003 20:46:05 +0100 Received: by mail.proteosys.com (8.12.3/8.12.2) with ESMTP id h27Jk3a9010746 for ; Fri, 7 Mar 2003 20:46:04 +0100 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [129.206.100.27]) by relay2.uni-heidelberg.de (8.12.8/8.12.8) with ESMTP id h27JdSle004928; Fri, 7 Mar 2003 20:39:28 +0100 (MET) MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C2E4E2.30AA3C80" Received: from listserv (listserv.uni-heidelberg.de [129.206.100.27]) by listserv.uni-heidelberg.de (8.12.3/8.12.3/SuSE Linux 0.6) with ESMTP id h27IjDwi003483; Fri, 7 Mar 2003 20:39:10 +0100 Received: from LISTSERV.UNI-HEIDELBERG.DE by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 1.8d) with spool id 7573 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Fri, 7 Mar 2003 20:39:10 +0100 X-MimeOLE: Produced By Microsoft Exchange V6.5 Received: from relay2.uni-heidelberg.de (relay2.uni-heidelberg.de [129.206.210.211]) by listserv.uni-heidelberg.de (8.12.3/8.12.3/SuSE Linux 0.6) with ESMTP id h27JdAwE003758 for ; Fri, 7 Mar 2003 20:39:10 +0100 Received: from nic.lth.se (nic.lth.se [130.235.20.3]) by relay2.uni-heidelberg.de (8.12.8/8.12.8) with ESMTP id h27JdHle004914 for ; Fri, 7 Mar 2003 20:39:17 +0100 (MET) Received: from [130.235.3.161] (mathcent81.maths.lth.se [130.235.3.161]) by nic.lth.se (8.12.8/8.12.8) with ESMTP id h27JdFmm000650 for ; Fri, 7 Mar 2003 20:39:16 +0100 (MET) In-Reply-To: <15976.50741.35120.781089@istrati.mittelbach-online.de> References: <630BE70C8320D6118D240002A589ABB204A95102@DERUM201> Return-Path: X-OriginalArrivalTime: 07 Mar 2003 19:46:05.0847 (UTC) FILETIME=[312B7A70:01C2E4E2] X-Sender: lars@abel.math.umu.se x-mime-autoconverted: from quoted-printable to 8bit by listserv.uni-heidelberg.de id h27JdAwE003759 X-Scanned-By: MIMEDefang 2.28 (www . roaringpenguin . com / mimedefang) X-Spam-Score: -2.9 () EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT,REFERENCES,SPAM_PHRASE_00_01 Content-class: urn:content-classes:message Subject: Re: algorithm for \addvspace Date: Fri, 7 Mar 2003 20:39:56 +0100 Message-ID: A X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Re: algorithm for \addvspace Thread-Index: AcLk4jFIk5XeRTBMQGeUAixHw2+N2w== From: =?iso-8859-1?Q?Lars_Hellstr=F6m?= To: Reply-To: "Mailing list for the LaTeX3 project" Status: R X-Status: X-Keywords: X-UID: 4571 This is a multi-part message in MIME format. ------_=_NextPart_001_01C2E4E2.30AA3C80 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable At 17.17 +0100 2003-03-07, Frank Mittelbach wrote: > > I presume you meant to say something different here. The \lastskip < = 0 < > > SKIP case was never questioned. > >well but i question it. i find its behaviour even stranger than the = (mis)use >of a negative value to back up. > >my claim is that a negative skip in \lastskip is most likely there to = correct >for some visual property. so as far as the visual space provided by the = object >above it is likely equiv to 0pt and a following \addvspace should not = remove >it and insert its SKIP but simply should add its SKIP to achive the = visual >maximum. OK, I see your point. \vspace and \addvspace don't work well together, = and the _specifications_ (not just the implementations) of them are such = that they cannot work well together. Is this (when \addvspace is around, = \vspace might do the opposite to what you think) perhaps something that could = use a big warning in The LaTeX Companion? > > How about > > > > \def\correctvspace#1{% > > \relax % Won't hurt, and might help. > > \ifvmode > > \@tempskipb=3D\lastskip > > \vskip-\@tempskipb > > \vskip #1% > > \vskip\@tempskipb > > \else > > \@noitemerr > > \fi > > } > >looks simple enough, but needs some further thought as well. the above = will >violate the property of \addvspace and \addpenalty to properly interact = with >each other, or so i would think Yes. I believe that was what I wrote: > > ? There is a slight imperfection in that if the break is taken at a > > penalty abve the correction then it will disappear, whereas it will = not > > disappear if the break is taken at a penalty below the correction, = but I > > think that is reasonable behaviour. One could also provide for = inserting a > > penalty just before the correction skip. > >well not quite, a later \addpenalty should move backwards past the >correction space (nominally) on the vertical list. I don't think there is enough information available to do that. In principle, there could be a skip register which kept track of how much correction space has been added since the last \par ending a paragraph = or \everypar, but that wouldn't handle \hrule or explicit \hbox'es = correctly. One could argue that these aren't proper LaTeX anyway, but they would = cause trouble in some cases. Also, if one was to keep track of the amount of correction space added, then one should perhaps also keep track of the space added by = \addvspace, so that it wouldn't mistake a user-supplied \vspace for some previous \addvspace space. Or something. That too gets rather complicated. As for \correctvspace, I think the above implementation would be OK if = it is only to be used for "late corrections" similar to those made using \enlargethispage: We have already seen where the page breaks will go, = and that's not at the point where the command is used. Lars Hellstr=F6m ------_=_NextPart_001_01C2E4E2.30AA3C80 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Re: algorithm for \addvspace

At 17.17 +0100 2003-03-07, Frank Mittelbach = wrote:
> > I presume you meant to say something = different here. The \lastskip < 0 <
> > SKIP case was never questioned.
>
>well but i question it. i find its behaviour even = stranger than the (mis)use
>of a negative value to back up.
>
>my claim is that a negative skip in \lastskip is = most likely there to correct
>for some visual property. so as far as the visual = space provided by the object
>above it is likely equiv to 0pt and a following = \addvspace should not remove
>it and insert its SKIP but simply should add its = SKIP to achive the visual
>maximum.

OK, I see your point. \vspace and \addvspace don't = work well together, and
the _specifications_ (not just the implementations) = of them are such that
they cannot work well together. Is this (when = \addvspace is around, \vspace
might do the opposite to what you think) perhaps = something that could use a
big warning in The LaTeX Companion?

> > How about
> >
> > \def\correctvspace#1{%
> >    \relax % Won't hurt, and = might help.
> >    \ifvmode
> >       = \@tempskipb=3D\lastskip
> >       = \vskip-\@tempskipb
> >       \vskip = #1%
> >       = \vskip\@tempskipb
> >    \else
> >       = \@noitemerr
> >    \fi
> > }
>
>looks simple enough, but needs some further = thought as well. the above will
>violate the property of \addvspace and = \addpenalty to properly interact with
>each other, or so i would think

Yes. I believe that was what I wrote:

> > ?  There is a slight imperfection in = that if the break is taken at a
> > penalty abve the correction then it will = disappear, whereas it will not
> > disappear if the break is taken at a = penalty below the correction, but I
> > think that is reasonable behaviour. One = could also provide for inserting a
> > penalty just before the correction = skip.
>
>well not quite, a later \addpenalty should move = backwards past the
>correction space (nominally) on the vertical = list.

I don't think there is enough information available to = do that. In
principle, there could be a skip register which kept = track of how much
correction space has been added since the last \par = ending a paragraph or
\everypar, but that wouldn't handle \hrule or = explicit \hbox'es correctly.
One could argue that these aren't proper LaTeX = anyway, but they would cause
trouble in some cases.

Also, if one was to keep track of the amount of = correction space added,
then one should perhaps also keep track of the space = added by \addvspace,
so that it wouldn't mistake a user-supplied \vspace = for some previous
\addvspace space. Or something. That too gets rather = complicated.

As for \correctvspace, I think the above = implementation would be OK if it
is only to be used for "late corrections" = similar to those made using
\enlargethispage: We have already seen where the page = breaks will go, and
that's not at the point where the command is = used.

Lars Hellstr=F6m

------_=_NextPart_001_01C2E4E2.30AA3C80--