The argument for \kern
is a ⟨dimen⟩, so TeX first looks for a ⟨decimal number⟩ (which can be an integer in any admissible representation, or a fractional number in decimal notation, with period or comma for separating the fractional part) and then for a ⟨unit of measure⟩, that is, a pair of letters representing one of the accepted units (pt, cm, mm, in, dd, pc, cc, bp, sp, em, ex). Any number of spaces between the numbers and the units are ignored, an optional space can follow the unit (it is looked for with expansion). Any other pair of letters will trigger an error message
! Illegal unit of measure (pt inserted).
Thus \kern37pclike
has a correct value for \kern
, but \kern 37 pc like
would have given exactly the same result.
Be careful with \kern
, because it's a command that does different things if called in vertical or horizontal (or math) mode. Using \enspace
before having started a paragraph will make you scratch your head.
The argument to \hskip
should instead be a ⟨skip⟩; the same as before applies, but after the ⟨dimen⟩ stating the natural width, TeX looks for the keyword plus
or minus
(with expansion). If it finds it, it looks again for a ⟨dimen⟩ with the same rules as before, but the ⟨decimal number⟩ can also be followed by fil
, fill
or filll
(not the real truth, but a good approximation) again with a trailing optional space that's looked for and ignored. Notwithstanding if plus
is found or not, TeX looks for a minus
keyword, same rules.
So \hskip 2pt minuscule chances of errors
will trigger a puzzling error message.
The same as before is valid whenever TeX is looking for a ⟨dimen⟩ or a ⟨skip⟩. In case of doubts, particularly with a ⟨skip⟩, add \relax
, which is what \setlength
, \hspace
and \vspace
do in LaTeX.
l
(ell) in the first case, which is not a length, then decides that the kern is ended, inserts the kern, and keeps going with the ell. The\hskip
does the same, but withc
. In case of an space, it's gobbled. Better use\kern37pt like
and\hskip100pt cake
. (Disclaimer: I'm a not specially proficient in TeX.)\kern{37pt}
breaks. TeX is really the worst when it comes to consistent syntax.\kern37pt
, the{..}
is not the syntax. Of course it crashes.\kern{37pt}
if\kern
weren't already a TeX dimension command, which has its own syntax.\def\whatever{\afterassignment\dowhatever\dimen0=}
, then\whatever37ptlike
would work and use\dowhatever
, after storing37pt
in\dimen0
.