what does \[length] mean? like this:
\documentclass{article}
\begin{document}
mmmmm\\[-0.33em]
mmmmm
mmmmm
\hspace{-0.33em}mmmmm
\end{document}
why are these do not render the same?
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityTo begin with, LaTeX commands can take both required and optional arguments. Required arguments are (generally) enclosed by curly braces, while optional arguments are enclosed by square brackets.
Next, if the string
mmmmm\\[-0.33em]
occurs inside an array
or a tabular
-like environment, the sub-string \\
is the instruction to insert a line break and [-0.33em]
represents an optional argument to the \\
instruction. If the argument, which is supposed to be a length, is a positive, additional vertical whitespace -- in the amount of that argument -- will be inserted; it it's negative, that amount will be subtracted from the default amount of vertical space that's inserted by \\
.
(Aside: If you use \\
outside of array
and tabular
-like environments, it's quite likely that you're doing something wrong...)
In contrast, \hspace
is a text-mode command that serves to insert or subtract horizontal space. Incidentally, to LaTeX, \hspace{0pt}
is not the same as "doing nothing" -- inserting "zero-length whitespace" can have significant and (if used correctly) very handy use cases.
In short, there's no reason to believe that \\[-0.33em]
and \hspace{-0.33em}
would, let alone should, produce the same outcome.
pkuthss
, it is in a section
like ` \section*{mmmmmmmmm \[-0.33em]\textmd{xxxxxxxxxxxxxxxxxxx}}, so it should be equal to a line break plus
\vspace{-0.33em}`?
Jun 4 at 5:05
array
and tabular
settings, do not serve such a legitimate purpose...