If I understand correctly, when entering unrestricted horizontal mode, TeX inserts a parskip if the containing vertical list is non-empty. That applies even when the only item on the list is not actually a paragraph, but e.g. a special:
\vbox{\special{}x}
Is there a way to prevent the parskip in this case?
More specifically, how would I write a macro \foo
that involves \special
and should work in both of these cases:
\vbox{\foo x}
\vbox{\foo\hbox{x}}
i.e. whether or not horizontal mode will be entered after the macro. The first case could be solved by adding \leavevmode
to the macro, but for the second case, that is not an option.
But I can't detect during expansion of \foo
if \leavevmode
will be needed.
\color
sometimes affects spacing, it's bascally not soluable in classic tex