0

I've defined a macro that puts images and text in a table and puts some whitespace around it like that:

\newcommand{\iec}[3]{%
\unskip
\vskip 0.5cm
\begin{tabular}{cl}
\adjustimage{width=1.5cm,valign=c}{/symbols/#1.pdf}&
\parbox[c]{12cm}{\textbf{#2}\\ \small #3} \\
\end{tabular}
\vskip 0.5cm
}

The first unskip is used to consume the last vskip of the previous object so that additional vskips don't add up when using the macro several times consecutive.

The first vskip works nice when used in a block of text, but when the macro is used directly after a heading (be it section or subsection) I would like to omit the extra whitespace. Is there a simple way to achieve this?

  • 2
    neither vskip nor unskip are expected to be used mid document, better to use \addvspace which is defined in latex to handle adjacent skips – David Carlisle Oct 28 at 16:33
  • Oh wow. Didn't know that. Thanks! – Dschoni Oct 28 at 16:42
  • @DavidCarlisle Actually the \addvspace helps in mitigating the need to have an additional unskip however, there's still unwanted additional whitespace when used directly after a heading. – Dschoni Oct 29 at 8:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.