[Tex/LaTex] Adding a “minimum” vertical space

spacing

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.

Best Answer

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.

Related Question