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
Condense Mail Headers

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

Print Reply
Mime-Version:
1.0
Content-Type:
text/plain; charset="iso-8859-1"
Date:
Fri, 7 Mar 2003 14:46:52 +0100
Reply-To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Subject:
From:
Lars Hellström <[log in to unmask]>
In-Reply-To:
Content-Transfer-Encoding:
8bit
Sender:
Mailing list for the LaTeX3 project <[log in to unmask]>
Parts/Attachments:
text/plain (172 lines)
At 13.05 +0100 2003-03-07, Frank Mittelbach wrote:
>Lars,
>
> > 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).

Yes (you wouldn't have had to tell _me_ that; I know it is much too late to
change such behaviour in the 2e core).

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

I do claim that it is wrong, but cannot be fixed in the 2e core. It could
be another candidate for fixltx2e.sty.

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

Cleans up the code, and removes questionable behaviour (discontinuity,
nonmonotonicity).

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

I presume you meant to say something different here. The \lastskip < 0 <
SKIP case was never questioned.

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

OK, I can't claim I have ever learnt what these flags signify anyway. If
it's a "beginning of minipage" flag then it makes perfect sense.

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

We're thinking about different things, but I can see that your
\correctspace would be more useful. I was merely thinking about preserving
the "invariant" that \lastskip is the effective total amount of vertical
glue since the last non-discardable item, which is what \addvspace and
\addvpentalty rely on.

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

Don't you mean:                              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

How about

\def\correctvspace#1{%
   \relax % Won't hurt, and might help.
   \ifvmode
      \@tempskipb=\lastskip
      \vskip-\@tempskipb
      \vskip #1%
      \vskip\@tempskipb
   \else
      \@noitemerr
   \fi
}

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

Lars Hellström

ATOM RSS1 RSS2