At any point in its processing, TeX is in some mode. There are six modes, divided in threecategories:
When not typesetting mathematics, TeX is in horizontal or vertical mode.Horizontal mode is typically used to make lines of text; vertical mode is typically used to stack the lines of a paragraph on top of each other.
\vskip
inserts a glue in a vertical list of the lines. Therefore \vskip
breaks the horizontal mode and goes to the vertical mode.
\vspace
can work in horizontal mode and vertical mode.In horizontal mode \vspace 1mm
is equivalent to \vadjust{\vskip 1mm \vskip 0pt}
and inserts a space after the current line.In vertical mode \vspace 1mm
is equivalent to \vskip 1mm \vskip 0pt
\vskip 0pt
is needed so \removelastskip
can not remove your vertical space.
Full definition:
\vspace : -> \@ifstar \@vspacer \@vspace
Without *
case (\vspace 1mm
):
\@vspace: #1->\ifvmode \vskip #1 \vskip \z@skip \else \@bsphack \vadjust {\@restorepar \vskip #1 \vskip \z@skip }\@esphack \fi
Note \z@skip
equal to 0pt
, \@bsphack
is needed to save big horizontal space after period.\@esphack
is needed to return big space settings.
With *
case (\vspace* 1mm
):
\@vspacer:#1->\ifvmode \dimen@ \prevdepth \hrule \@height \z@ \nobreak \vskip #1 \vskip \z@skip \prevdepth \dimen@ \else \@bsphack \vadjust {\@restorepar \hrule @height \z@ \nobreak \vskip #1 \vskip \z@skip }\@esphack \fi
联系客服