Received: from mail.proteosys.com ([62.225.9.49]) by nummer-3.proteosys with Microsoft SMTPSVC(5.0.2195.5329); Fri, 7 Mar 2003 11:37:21 +0100 Received: by mail.proteosys.com (8.12.3/8.12.2) with ESMTP id h27AbFa9009297 for ; Fri, 7 Mar 2003 11:37:19 +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 h27AJple025711; Fri, 7 Mar 2003 11:19:51 +0100 (MET) MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C2E495.886E8680" 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 h270Rl3Q028465; Fri, 7 Mar 2003 11:18:16 +0100 Received: from LISTSERV.UNI-HEIDELBERG.DE by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 1.8d) with spool id 6814 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Fri, 7 Mar 2003 11:18:16 +0100 X-MimeOLE: Produced By Microsoft Exchange V6.5 Received: from relay.uni-heidelberg.de (relay.uni-heidelberg.de [129.206.100.212]) by listserv.uni-heidelberg.de (8.12.3/8.12.3/SuSE Linux 0.6) with ESMTP id h27AIGwE032433 for ; Fri, 7 Mar 2003 11:18:16 +0100 Received: from nic.lth.se (nic.lth.se [130.235.20.3]) by relay.uni-heidelberg.de (8.12.8/8.12.8) with ESMTP id h27AIM0j015348 for ; Fri, 7 Mar 2003 11:18:23 +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 h27AIKmm026421 for ; Fri, 7 Mar 2003 11:18:21 +0100 (MET) In-Reply-To: <15975.54592.932836.969382@istrati.mittelbach-online.de> References: <630BE70C8320D6118D240002A589ABB204A95102@DERUM201> Return-Path: X-OriginalArrivalTime: 07 Mar 2003 10:37:22.0735 (UTC) FILETIME=[897743F0:01C2E495] X-Sender: lars@abel.math.umu.se x-mime-autoconverted: from quoted-printable to 8bit by listserv.uni-heidelberg.de id h27AIGwE032434 X-Scanned-By: MIMEDefang 2.28 (www . roaringpenguin . com / mimedefang) X-Spam-Score: -1.3 () 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 11:18:59 +0100 Message-ID: A X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Re: algorithm for \addvspace Thread-Index: AcLklYmVXzVqSBR4R2uxCgCh8Uhebw== 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: 4567 This is a multi-part message in MIME format. ------_=_NextPart_001_01C2E495.886E8680 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable At 00.09 +0100 2003-03-07, Frank Mittelbach wrote: >i starred at that definition once more (probably done so several times = in the >past :-) but i think it has some understandable logic (i'm not saying = that it >has the world's best implementation for it) after all. > >basically it goes like this: > >the main intention why the command was introduced in the first place to = is the >following: > > if there are two objects A and B that both want to > produce some space after/before them then if both objects are = directly > after each other one usually does not want to put too much space = between > them, so a good approach is to use the maximum Yes, that makes perfect sense (although the name does not). >now an assumption that i think was made is that the skips that >actually end up being on the galley are positive and in fact i >think this is virtually always the the case. Note that i talk >about the skips on the galley not the skip used the >last time in an \addvspace command, e.g. the cited example > > \addvspace{-\parskip} %% added 4 Sep 85 > >i actually one in a sequence > > \addpenalty\@beginparpenalty > \addvspace\@topsep > \addvspace{-\parskip}% > >and the net effect of \topsep-\parskip is normally positive. Yes, but then it should have been \addpenalty\@beginparpenalty \@tempskipb=3D\@topskip \advance \@tempskipb -\parskip \addvspace\@tempskipb because otherwise the net results will be wrong (less than \lastskip) = when \topsep-\parskip < \lastskip < \topsep >so back to the theme if producing the maximum is sensible then what to = do >about > > SKIP < 0pt ? > >i think that Leslie thought this to be a good way to extend the command = to >allow for corrective actions if necessary > >why he additionally required \lastskip > 0pt is beyond me though. > >it means that SKIP < \lastskip < 0pt again uses the maximum principle = but >that doesn't make much sense to me. > >so much for how i read history two minutes before midnight (perhaps all >rubbish) > >well, how could a simpler command look like? A first approximation would be like this: \def\MinimalVspace#1{% \ifvmode \if@minipage \else \ifdim \lastskip =3D\z@ \vskip #1\relax \else \@tempskipb#1\relax \ifdim \lastskip<\@tempskipb \vskip-\lastskip \vskip\@tempskip \fi \fi \fi \else \@noitemerr \fi } It is quite possible that the special code for \lastskip=3D\z@ should = also be removed, but with \parskip =3D 0pt plus 1pt being quite common, that = change could actually be noticable. As for the name, I think this would be more intuitive. The user (or = perhaps rather class designer) is requesting that at least this amount of vspace should appear at this point. >>Also, it seems to me as if there could be a need for two commands = here: one >>which does what (the simplified) \addvspace does (guarantees that = there is >>at least a certain amount of vertical space in the last mix of = penalties >>and glue), and one which actually makes the vertical space a certain = amount >>larger (without messing it up for any subsequent \addvspace or >>\addvpenalty). > >i can see how to define a user command for corrective actions always = adjusts >the space in either direction, the only problem is that its natural = name >(addvspace) is already taken Well, there's always \def\AddVspace#1{% Or maybe \reallyaddvspace \ifvmode \if@minipage \else \@tempskipb#1\relax \advance \@tempskipb \lastskip \vskip-\lastskip \vskip\@tempskip \fi \else \@noitemerr \fi } I'm not too certain about whether the minipage condition should be = present here, though. Lars Hellstr=F6m ------_=_NextPart_001_01C2E495.886E8680 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Re: algorithm for \addvspace

At 00.09 +0100 2003-03-07, Frank Mittelbach = wrote:
>i starred at that definition once more (probably = done so several times in the
>past :-) but i think it has some understandable = logic (i'm not saying that it
>has the world's best implementation for it) after = all.
>
>basically it goes like this:
>
>the main intention why the command was introduced = in the first place to is the
>following:
>
>  if there are two objects A and B that both = want to
>  produce some space after/before them  = then if both objects are directly
>  after each other one usually does not want = to put too much space between
>  them, so a good approach is to use the = maximum

Yes, that makes perfect sense (although the name does = not).

>now an assumption that i think was made is that = the skips that
>actually end up being on the galley are positive = and in fact i
>think this is virtually always the the case. Note = that i talk
>about the skips on the galley not the skip used = the
>last time in an \addvspace command, e.g. the = cited example
>
>        = \addvspace{-\parskip}   %% added 4 Sep 85
>
>i actually one in a sequence
>
>        = \addpenalty\@beginparpenalty
>        = \addvspace\@topsep
>        = \addvspace{-\parskip}%
>
>and the net effect of \topsep-\parskip is = normally positive.

Yes, but then it should have been

    \addpenalty\@beginparpenalty
    \@tempskipb=3D\@topskip
    \advance \@tempskipb = -\parskip
    \addvspace\@tempskipb

because otherwise the net results will be wrong (less = than \lastskip) when

    \topsep-\parskip < \lastskip = < \topsep


>so back to the theme if producing the maximum is = sensible then what to do
>about
>
>    SKIP < 0pt ?
>
>i think that Leslie thought this to be a good way = to extend the command to
>allow for corrective actions if necessary
>
>why he additionally required  \lastskip > = 0pt is beyond me though.
>
>it means that  SKIP < \lastskip < 0pt = again uses the maximum principle but
>that doesn't make much sense to me.
>
>so much for how i read history two minutes before = midnight (perhaps all
>rubbish)
>
>well, how could a simpler command look = like?

A first approximation would be like this:

\def\MinimalVspace#1{%
   \ifvmode
      \if@minipage = \else
         = \ifdim \lastskip =3D\z@
          &nbs= p; \vskip #1\relax
         = \else
          &nbs= p; \@tempskipb#1\relax
          &nbs= p; \ifdim \lastskip<\@tempskipb
          &nbs= p;    \vskip-\lastskip
          &nbs= p;    \vskip\@tempskip
          &nbs= p; \fi
         = \fi
      \fi
   \else
      \@noitemerr
   \fi
}

It is quite possible that the special code for = \lastskip=3D\z@ should also be
removed, but with \parskip =3D 0pt plus 1pt being = quite common, that change
could actually be noticable.

As for the name, I think this would be more intuitive. = The user (or perhaps
rather class designer) is requesting that at least = this amount of vspace
should appear at this point.

>>Also, it seems to me as if there could be a = need for two commands here: one
>>which does what (the simplified) \addvspace = does (guarantees that there is
>>at least a certain amount of vertical space = in the last mix of penalties
>>and glue), and one which actually makes the = vertical space a certain amount
>>larger (without messing it up for any = subsequent \addvspace or
>>\addvpenalty).
>
>i can see how to define a user command for = corrective actions always adjusts
>the space in either direction, the only problem = is that its natural name
>(addvspace) is already taken

Well, there's always

\def\AddVspace#1{% Or maybe \reallyaddvspace
   \ifvmode
      \if@minipage = \else
         = \@tempskipb#1\relax
         = \advance \@tempskipb \lastskip
         = \vskip-\lastskip
         = \vskip\@tempskip
      \fi
   \else
      \@noitemerr
   \fi
}

I'm not too certain about whether the minipage = condition should be present
here, though.

Lars Hellstr=F6m

------_=_NextPart_001_01C2E495.886E8680--