Received: from mail.proteosys.com ([62.225.9.49]) by nummer-3.proteosys with Microsoft SMTPSVC(5.0.2195.5329); Fri, 7 Mar 2003 13:12:18 +0100 Received: by mail.proteosys.com (8.12.3/8.12.2) with ESMTP id h27CCFa9009490 for ; Fri, 7 Mar 2003 13:12:16 +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 h27C6Ule025122; Fri, 7 Mar 2003 13:06:30 +0100 (MET) MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C2E4A2.CC1BBD00" 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 h270Rl52028465; Fri, 7 Mar 2003 13:05:32 +0100 Received: from LISTSERV.UNI-HEIDELBERG.DE by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 1.8d) with spool id 6889 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Fri, 7 Mar 2003 13:05:32 +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 h27C5VwE000717 for ; Fri, 7 Mar 2003 13:05:31 +0100 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.187]) by relay.uni-heidelberg.de (8.12.8/8.12.8) with ESMTP id h27C5c0j015411 for ; Fri, 7 Mar 2003 13:05:38 +0100 (MET) Received: from [212.227.126.206] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 18rGbZ-0004XR-00 for LATEX-L@listserv.uni-heidelberg.de; Fri, 07 Mar 2003 13:05:37 +0100 Received: from [80.129.6.245] (helo=istrati.mittelbach-online.de) by mrelayng.kundenserver.de with asmtp (TLSv1:EDH-RSA-DES-CBC3-SHA:168) (Exim 3.35 #1) id 18rGbX-0005Yq-00 for LATEX-L@listserv.uni-heidelberg.de; Fri, 07 Mar 2003 13:05:37 +0100 Received: (from frank@localhost) by istrati.mittelbach-online.de (8.11.2/8.11.2/SuSE Linux 8.11.1-0.5) id h27C57x30562; Fri, 7 Mar 2003 13:05:07 +0100 In-Reply-To: References: <630BE70C8320D6118D240002A589ABB204A95102@DERUM201> Return-Path: X-Mailer: VM 6.96 under Emacs 20.7.1 X-OriginalArrivalTime: 07 Mar 2003 12:12:18.0629 (UTC) FILETIME=[CC7BB750:01C2E4A2] X-Authentication-Warning: istrati.mittelbach-online.de: frank set sender to frank@mittelbach-online.de using -f X-Scanned-By: MIMEDefang 2.28 (www . roaringpenguin . com / mimedefang) X-Spam-Score: -0.7 () IN_REP_TO,REFERENCES,SPAM_PHRASE_00_01,X_AUTH_WARNING Content-class: urn:content-classes:message Subject: Re: algorithm for \addvspace Date: Fri, 7 Mar 2003 13:05:07 +0100 Message-ID: A<15976.35571.591332.566230@istrati.mittelbach-online.de> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Re: algorithm for \addvspace Thread-Index: AcLkosyj7gqML1ZJSkOWlFUx3rTQCg== From: "Frank Mittelbach" To: Reply-To: "Mailing list for the LaTeX3 project" Status: R X-Status: X-Keywords: X-UID: 4568 This is a multi-part message in MIME format. ------_=_NextPart_001_01C2E4A2.CC1BBD00 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Lars, > > 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). yes, kind of, but this is really history and we can't change that name = for 2e not even the semantics i would guess (unless put into fixltx2e). > >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 yes again. but this is from around 1986 i fear. so you can claim it is = not wrong but strange > >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 > } what precisely does this gain you? if used with positive skips nothing = as it is identical to \addvspace and this is what \addvspace is used for (or = should be used for, the strange usage in list is something i wouldn't count = here) the logic is still as strange as before in the case \lastskip is = negative and skip positive. > 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. haven't thought of that before, indeed, this is different from using the maximum of \lastskip,SKIP, hmmm the if minipage flag is necessary or else you get strange and unwanted = effects at the beginning of a box, you really don't want to start there with a = space (normally) > 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. but you could document \addvspace clearer and have the same. > >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 take my remark back from last night, I don't see how to easily define = the corrective action command. the above doesn't do the job (i think) reason: typical situation is like this \addvspace{8pt} % from the end of some object \correctspace{2pt} % what to put here to change the spacing??????? \addvspace{10pt} % from the beginning of a new object eg end of list followed by \section now the place where the user can put in his/her correction command is = between the two \addvspace commands. so if one things the space is too small and = wants to change that, eg add 2pts then nothin there will give us 10pt total, ie max(8pt,10pt) \vspace{2pt} will give us 18pt total, ie 8pt + max(2pt,10pt) \AddVspace{2pt} will give us 10pt total, ie max(max(8pt,2pt),10pt) \vspace{-2pt} by the way will also give 18pt which is really the beauty = of thescheme :-) but if 8pt and 10pt are in the opposite places then \AddVspace{2pt} suddenly works so i think this needs a far more complex integration between \addvspace = (or whatever the name is for the thing to be used at the border of objects) = and the corrective command for use in documents drawing board frank ------_=_NextPart_001_01C2E4A2.CC1BBD00 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Re: algorithm for \addvspace

Lars,

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

yes, kind of, but this is really history and we can't = change that name for 2e
not even the semantics i would guess (unless put into = fixltx2e).

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

yes again. but this is from around 1986 i fear. so you = can claim it is not
wrong but strange


 > >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
 > }

what precisely does this gain you? if used with = positive skips nothing as it
is identical to \addvspace and this is what = \addvspace is used for (or should
be used for, the strange usage in list is something i = wouldn't count here)

the logic is still as strange as before in the case = \lastskip is negative and
skip positive.

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

haven't thought of that before, indeed, this is = different from using the
maximum of \lastskip,SKIP, hmmm

the if minipage flag is necessary or else you get = strange and unwanted effects
at the beginning of a box, you really don't want to = start there with a space
(normally)

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

but you could document \addvspace clearer and have the = same.


 > >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 take my remark back from last night, I don't see how = to easily define the
corrective action command. the above doesn't do the = job (i think)

reason: typical situation is like this


\addvspace{8pt}       % = from the end of some object
\correctspace{2pt}    % what to put = here to change the spacing???????
\addvspace{10pt}       = % from the beginning of a new object

eg end of list followed by \section

now the place where the user can put in his/her = correction command is between
the two \addvspace commands. so if one things the = space is too small and wants
to change that, eg add 2pts then

nothin there    will give us 10pt = total, ie  max(8pt,10pt)
\vspace{2pt}    will give us 18pt = total, ie 8pt + max(2pt,10pt)
\AddVspace{2pt} will give us 10pt total, ie = max(max(8pt,2pt),10pt)

\vspace{-2pt} by the way will also give 18pt which is = really the beauty of
thescheme :-)

but if 8pt and 10pt are in the opposite places = then
\AddVspace{2pt} suddenly works

so i think this needs a far more complex integration = between \addvspace (or
whatever the name is for the thing to be used at the = border of objects) and
the corrective command for use in documents

drawing board

frank

------_=_NextPart_001_01C2E4A2.CC1BBD00--