96

Is there ever a difference between \vspace{...} and \vspace*{...} if a negative argument is supplied?

Most importantly, does the choice of which macro to use have an influence on page breaking behavior?

1 Answers1

107

I don't think the sign of the argument matters, Without the * the skip is always discarded at the start of the page, and with the * it is not discarded.


To answer the second question added later, it shouldn't affect the page before the break (although it may be possible to generate edge cases where it does) but it will of course affect the positioning of the first box on the page after the break and so will affect all subsequent breaks.

David Carlisle
  • 757,742
  • 9
    So \newpage\vspace{-2cm}Hello will print Hello inside the page frame, whereas \newpage\vspace*{-2cm}Hello will print it somewhere probably inside the page header? – yo' Oct 10 '12 at 08:22
  • 4
    That's the idea yes. – David Carlisle Oct 10 '12 at 08:23
  • I see. What I meant was whether the choice of \vspace vs \vspace* has any influence on page breaking behavior when the page break is automatically calculated and not manually given. (I've edited the question text to reflect this.) – Lover of Structure Oct 10 '12 at 08:25
  • @user14996 I believe there's no difference, because the only way how to have negative \vspace at the beginning of page is after a forced page-break IMO. – yo' Oct 10 '12 at 08:28
  • 4
    @tohecz no you can have a non-forced break at a negative space. A space inserts discardable space and inserts a break point so if you have a sequence of large unbreakable boxes each separated by a negative space they will overlap if on the same page but will break at the skip between boxes, the first box on each new page will or will not overlap the header depending on * – David Carlisle Oct 10 '12 at 08:32
  • From your answer I infer that in practice one should nearly always prefer \vspace over \vspace* if a negative argument is supplied? – Lover of Structure Oct 10 '12 at 08:52
  • (And: David, did you try it out? I believe your content, but just making sure.) – Lover of Structure Oct 10 '12 at 08:57
  • 6
    well as I said originally the sign doesn't really affect the choice much. It's nearly always the case that you don't want the * form. The man use of the * form is for special layouts like titles or chapter heads where you are after a forced break and you may want to have negative spacing to insert a graphic or some such that overlaps the head area as you know the pagestyle has an empty headline or you may want positive spacing, it all depends. – David Carlisle Oct 10 '12 at 08:58
  • No. If the OP provides a minimal example as a complete document I always test my answers, if they don't, I don't:-) – David Carlisle Oct 10 '12 at 08:59
  • Allright, I've tested your overlapping boxes example, and you are right.
  • – Lover of Structure Oct 11 '12 at 05:34
  • However I would say that it is not immediately apparent to a learner of LaTeX whether the \vspace*{-...} would be considered to be at the beginning of the new page or at the bottom of the old page - for all I know LaTeX could first be typesetting the negative vertical space, then attempt to typeset the next float, and then decide to move over the float (without the vertical space) to the next page. Note that this is consistent with the view that positive vertical space can be moved to the next page (and either preserved or discarded there).
  • – Lover of Structure Oct 11 '12 at 05:35