Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Is there a way to add vertical space, but only if that much vertical space has not already been added? In other words, to say "put a minimum of X points of space here, and if some other command has already put in X or more points, do nothing"?

For example, I have a command which creates a blank line and then begins a paragraph, but it puts in too much space when used after a section heading, since the section heading already puts in its own space.

share|improve this question
    
@vanden: Sure, the syntax would be appreciated. And in the real document, it's a multiple of \baselineskip - I just put in points for simplicity. –  Reid Jul 31 '10 at 17:10

1 Answer 1

up vote 19 down vote accepted

Sounds like \addvspace is the command that you are looking for. Simply use \addvspace instead of \vspace and you will get the maximum of the lengths instead of the sum of the lengths whenever you have multiple consecutive spaces.

If you are using the titlesec package to define your section headings, also have a look at the package option largestsep.

share|improve this answer
1  
+1 I didn't know about that; thanks! (I've removed my hacky gets-kinda-close-but-not-really answer.) –  vanden Aug 1 '10 at 15:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.