# LaTeX sphack family of commands.

LaTeX offers a number of commands that can be used in macros that want to be invisible i.e., not leave any extra space when used in the middle of text. These macros include \@esphack, \@bsphack, \@Esphack, \@Vbsphack and can be found in ltspace.dtx.

Amongst all these commands \@vbsphack stands alone as it is described in the source, but not implemented and commented as follows:

Another variant which is useful for invisible things which should not live in vmode (this is how some people feel about marginals). If it occurs in vmode then it enters hmode and ensures that \@savsk is nonzero so that the \ignorespaces is put in later. It is not used at present.

The macro definition is copied below:

\def \@vbsphack{ %
\relax \ifvmode
\leavevmode
\@savsk 1sp
\@savsf \spacefactor
\else
\ifhmode
\@savsk \lastskip
\@savsf \spacefactor
\fi
\fi
}


Can someone explain why should the \@savsk should be non-zero? The explanation offered in the source is not very clear.

Lastly as I am sure the name of these macros is not a lisp relic, can anyone offer the origin or history of how the family name was derived?

-

I can help at least on the naming: these are 'space hacks' to try to avoid messing up spacing with commands that 'do nothing' in output terms. So you have \@bsphack = 'begin space hack', \@esphack = 'end space hack'. I think \@Esphack is intended only for floats, but on this I'm not certain.
The reason for making \@savsk nonzero is because it moves into horizontal mode (\leavevmode) and \@esphack checks if \@savsk is positive. If it is, then it uses \ignorespaces to gobble space tokens (as the quote says).