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:


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}

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.

  • this is why \color sometimes affects spacing, it's bascally not soluable in classic tex Aug 1, 2022 at 20:58

1 Answer 1


This is why \color sometimes affects spacing, it's basically not soluable in classic tex.

Using e-tex you can catch some cases




\vbox{\foo x}


produces a box

...\hbox(4.30554+0.0)x469.75499, glue set 444.47719fil
....\tenrm x
....\penalty 10000
....\glue(\parfillskip) 0.0 plus 1.0fil
....\glue(\rightskip) 0.0

where the special is immediately before the hbox with x.

This basically detects if it is at the start of a vbox and if so makes a vbox without the \special then re-boxes it after adding the \special But using such code without breaking something is hard in real documents

Your Answer

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

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