LATEX-L Archives

Mailing list for the LaTeX3 project

LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

Options: Use Forum View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Frank Mittelbach <[log in to unmask]>
Reply To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Date:
Fri, 7 Mar 2003 13:05:07 +0100
Content-Type:
text/plain
Parts/Attachments:
text/plain (135 lines)
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=\@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 =\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=\z@ should also be
 > removed, but with \parskip = 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

ATOM RSS1 RSS2