I have a series of figure-like paragraphs generated by a command of mine, and would like to have a minimum amount of vertical space above and below these figure-like paragraphs, but I don't want the double the space when two of them follow eachother.
Using css, I would use the following code, since CSS merges two consecutive margins and leaves only a space equivalent to the largest :
.myclass { margin-top: 1cm; margin-bottom: 1cm; }
I can achieve the result I want (the same space above the first \mycommand, between the two \mycommand, and after the second \mycommand) using the following LaTeX code, but I would like to avoid the \vskip 1cm that I manually added after the second \mycommand :
\documentclass{article}
\usepackage{lipsum}
\def\mycommand{
\bgroup
\vskip 1cm
\rule{10cm}{2cm}
\par
\egroup
}
\begin{document}
\lipsum[1]
\mycommand
\mycommand
\vskip 1cm
\lipsum[2]
\lipsum[3]
\end{document}

If I choose the option to redefine \mycommand like this, then I have twice the space between the first \mycommand and the second :
\def\mycommand{
\bgroup
\vskip 1cm
\rule{10cm}{2cm}
\par
\vskip 1cm
\egroup
}

I have tried fiddling with TeX's glues (1cm minus 1cm for example), but didn't get the result I want.
