Tell LaTeX to leave 2cm here and it leaves 2cm. But the moment that same \vspace{2cm} lands at the top of a page, the length vanishes without a trace. That is not a bug. Space in LaTeX is not a fixed measurement but glue: something that stretches, shrinks, and gets thrown away once it is no longer wanted. This page works through the units of length (pt, bp, em, ex), the commands that actually emit space (\hspace, \vspace and their starred forms) and rubber lengths, all along one thread — why pt and bp differ by 0.375%, why em changes between two fonts of the same nominal size, and what the star in \hspace* is protecting.
pt vs bp: the units a LaTeX length can use
A length is always a number followed by a unit. Decimals and negative values are fine — 12pt, 2.5cm, -3mm — but drop the unit and the run stops with ! Illegal unit of measure (pt inserted)., the message you get from \hspace{2} or \setlength{\mylen}{5} and one of the most common errors in all of LaTeX. The units themselves fall into two families: absolute units, whose value is fixed whatever font is active (pt, bp, in, cm, mm, pc), and font-relative units, which read their value out of the font currently in use (em, ex).
The anchor of the absolute family is pt, the TeX point. Knuth took the Anglo-American printer’s point exactly as the trade used it: 1 inch = 72.27pt. Alongside it TeX carries a second point, bp (the big point), defined as exactly 1/72 inch — the round number PostScript, and later PDF, made their standard. The two are not equal. 1bp = 1.00375pt precisely, so the big point is 0.375% larger and 100bp comes out as 100.375pt. Because PDF’s own coordinate grid counts in 1/72 inch, every number in an EPS or PDF BoundingBox is a bp; rewriting \includegraphics[width=100pt] as [width=100bp] therefore changes the picture by exactly that 0.375%. Giving figure sizes in millimetres is safer simply because the confusion cannot arise.
| Unit | What it is / conversion | Where it is used |
|---|---|---|
pt | TeX point. 1in = 72.27pt | The reference for every length; font sizes too |
bp | Big point. 1bp = 1.00375pt (72bp = 1in) | The PostScript/PDF point; the unit of a BoundingBox |
in | Inch. 1in = 72.27pt | US paper dimensions |
cm | Centimetre. 1cm = 28.45274pt | The practical default for margins and figures |
mm | Millimetre. 1mm = 2.84526pt | Fine-grained dimensions |
pc | Pica. 1pc = 12pt | Traditional typographic unit; column widths |
dd | Didot point. 1157dd = 1238pt (≈ 1.07pt) | Continental European letterpress tradition |
cc | Cicero. 1cc = 12dd = 12.8401pt | The Didot family’s equivalent of the pica |
sp | Scaled point. 1pt = 65536sp | TeX’s internal step for every length; never typed by hand |
px | Pixel. Defaults to 1px = 1bp = 1.00375pt | pdfTeX and friends only; set by \pdfpxdimen |
em | The quad the current font declares (\fontdimen6) | Font-relative; indents and horizontal gaps |
ex | The x-height of the current font (\fontdimen5) | Font-relative; vertical nudges tied to lowercase height |
mu | Math unit. 18mu = 1em | Math mode only; \, is 3mu, \; is 5mu |
Near the foot of the table sits sp, the scaled point — the smallest step TeX keeps lengths in, with 1pt = 65536sp. You will almost never type it, yet that step fixes both TeX’s precision and its ceiling. One sp is about 5.4 nanometres, far finer than the wavelength of visible light (400–700 nm); at the other end, the largest dimension TeX can hold, \maxdimen, is 16383.99998pt — barely 5.76 metres. Both numbers fall out of the same single constraint: a dimension is a whole number of sp and must stay below 2^30. The continental European letterpress units dd (Didot point, 1157dd = 1238pt) and cc (cicero, 1cc = 12dd) still work, but they rarely surface in a modern document.
em and ex change with the font
em is not “the font size.” It is the quad that the currently active font declares for itself — the value TeX calls \fontdimen6. The same nominal 10pt therefore gives different answers: in Computer Modern Roman at 10pt, 1em is exactly 10.00002pt, but switch to Computer Modern Typewriter at the same 10pt and 1em becomes 10.4999pt, while the italic gives 10.22217pt. The familiar gloss “em is the width of a capital M” does not survive measurement either: in cmr10 an M is 9.16669pt wide, narrower than 1em. The name is a leftover from metal type, where the em quad was a square of the body; the actual number is the font’s business.
ex works the same way, and holds the x-height the font declares (\fontdimen5). Computer Modern Roman at 10pt reports 4.30554pt; the sans-serif Computer Modern Sans at the same 10pt reports 4.44444pt. Choosing between the two is not a question of direction — “em for horizontal, ex for vertical” — but of what you want the space to track. Space that should follow the text advance takes em; a nudge that should follow the height of the lowercase takes ex. Math mode adds a third, mu (the math unit), with 18mu = 1em. \quad is literally \hskip1em and \qquad twice that, 2em; the thin space \, is 3mu in maths and a kern of 0.16667em (one sixth of an em) in text. The thick \; is 5mu, and the medium \: — 4mu — becomes available once you load amsmath.
% absolute units: the same length whatever font is active
\hspace{12pt} \hspace{2.5cm} \hspace{-3mm} \hspace{100bp}
% font-relative units: the font decides the value
\hspace{1em} \vspace{2ex}
% proof that em follows the font, not the point size
\rmfamily \the\dimexpr 1em\relax % 10.00002pt at 10pt
\ttfamily \the\dimexpr 1em\relax % 10.4999pt at 10ptRubber lengths: what plus and minus actually do
plus grants room to stretch and minus room to shrink. A length that cannot move, like 12pt, is a rigid length; one with slack, like 1cm plus 2mm minus 1mm, is a rubber length, and it reads “1cm normally, up to 1.2cm if needed, down to 0.9cm if squeezed.” For TeX this is not a special feature: within a line, a paragraph or a page, essentially all white space is stretchable glue. Lines meet both margins exactly because the spaces between words are rubber. Turn that around and a row of rigid \vspace{12pt}s is you taking away the room TeX had to negotiate with.
% rigid: exactly 1cm, always
\vspace{1cm}
% rubber: 1cm normally, up to 1.2cm, down to 0.9cm
\vspace{1cm plus 2mm minus 1mm}
% infinite stretch: 0pt at rest, grows without limit
\vspace{\fill}LaTeX’s \fill is a skip register holding 0pt plus 1fill — zero at rest, infinitely stretchable. Since infinite stretch always beats finite stretch, one \fill anywhere on a line or in a column stops all the ordinary finite glue around it from stretching at all. TeX grades infinity in three steps, fil < fill < filll: \hfil carries plus 1fil and \hfill carries plus 1fill, so when both appear on one line, \hfill takes the whole surplus. To split space by ratio, use \stretch{n}, which is 0pt plus n fill: \hspace{\stretch{2}} against \hspace{\stretch{1}} divides the leftover 2:1, while two equal \fills divide it evenly.
Does that elasticity actually do anything vertically? Sometimes. Under \flushbottom, which lines every page up to the same depth, TeX stretches the flexible glue already on the page — the \parskip between paragraphs (0pt plus 1pt by default), the space around headings, the odd \bigskip — until the column is exactly the height of the text area. Under \raggedbottom it does not, and the reason is a single line in the LaTeX kernel: \raggedbottom appends one glue, \vskip 0pt plus.0001fil, at the foot of the text. That hair of infinite stretch outranks every finite plus on the page and swallows the whole surplus, so the glue in the text keeps its natural size and the leftover piles up at the bottom. The standard classes then choose for you: article, report and book call \raggedbottom for a one-sided document and \flushbottom for twoside and twocolumn. Since article defaults to oneside, the plus and minus you wrote on a \vspace are barely called upon for page fitting there — declare \flushbottom if you want them to count.
\hspace vs \hspace*, plus \hfill and \dotfill
\hspace{length} is what puts horizontal space inside a line: \hspace{2cm} gives you 2cm — unless that space lands at the edge of a line. Every time TeX cuts a paragraph into lines it discards the glue adjacent to each break, so that no white space dangles past the right margin and no line begins mysteriously indented. The starred \hspace*{length} works around it. Look at the definition and all it does is place a zero-width \vrule and a \nobreak in front of the skip: a rule is a box, not glue, so it cannot be discarded, and the space behind it is no longer next to the break point. That is what you want when a first line has to carry a forced indent.
\hfill is the same thing as \hspace{\fill}: it drives whatever sits on either side as far apart as the line allows — the standard way to set one word flush left and another flush right. It is glue too, so it is discarded at a line edge; write \hspace*{\fill} when it must survive. When you want the gap filled rather than blank, \hrulefill draws a rule across it and \dotfill lays down dots; both are an \hfill that TeX fills with repeated leaders (\leaders and \cleaders). The leader between a contents entry and its page number is one, and so is the ruled line under a form field. For small fixed gaps, the font-relative \quad (1em), \qquad (2em) and \, keep their visual balance when the type size changes — a hard-coded 6pt does not.
Name:\hspace{2cm}Date:\par
\noindent Chapter 1\quad Introduction\dotfill 1\par
\noindent left\hfill centre\hfill right\par
\noindent Signature:\hrulefill\par
% 2:1 split of the leftover space
\noindent A\hspace{\stretch{2}}B\hspace{\stretch{1}}C\par
% survives even at the start of a line
\noindent\hspace*{2cm}forced indentWhy \vspace disappears at a page break
Because the same rule applies vertically. TeX discards the glue next to a break wherever the break falls, so a \vspace{3cm} that lands at the top of a page is gone in its entirety; measured directly, a \vspace{3cm} placed right after a \newpage contributes exactly nothing. That is usually what is behind “the space works everywhere except here.” The intent matches \hspace: no unexplained white band at the head of a page. The starred \vspace*{length} dodges it with the same trick — an \hrule of height 0 and a \nobreak placed just before the skip. Reach for \vspace* whenever the space must survive no matter where the page happens to break, such as a fixed drop above a chapter opening.
For everyday vertical gaps there are three ready-made sizes: \smallskip, \medskip and \bigskip, whose standard values are 3pt plus 1pt minus 1pt, 6pt plus 2pt minus 2pt and 12pt plus 4pt minus 4pt. In a 10pt document \baselineskip is 12pt, so a \bigskip is roughly one line. All three are rubber lengths and flex a little to suit the page. And now the previous paragraph bites: each is defined as an unstarred \vspace (\vspace\smallskipamount and so on), so at a page boundary they are discarded as ruthlessly as any other glue. That is why the space you put above a heading evaporates the moment the heading falls at the top of a page; write \vspace*{\bigskipamount} if it has to stay. The vertical \fill is \vfill (\vspace{\fill}), used to centre a one-line page or to drive a signature block down to the foot.
| Command | What it inserts | Discarded at a break? |
|---|---|---|
\hspace{len} | Horizontal glue of the given width | Yes, at a line edge |
\hspace*{len} | The same width, preceded by a zero-width \vrule | No |
\hfill | Same as \hspace{\fill}: 0pt plus 1fill | Yes |
\hfil | 0pt plus 1fil; one order weaker than \hfill | Yes |
\stretch{n} | 0pt plus n fill; splits space by ratio | Yes |
\hrulefill | An \hfill that fills the gap with a rule | Yes |
\dotfill | An \hfill that fills the gap with dots; contents leaders | Yes |
\quad | \hskip1em; a fixed gap that tracks the font | Yes |
\qquad | \hskip2em; twice \quad | Yes |
\, | Thin space: 3mu in maths, 0.16667em in text | No, it is a kern in text |
\vspace{len} | Vertical glue of the given height | Yes, at a page break |
\vspace*{len} | The same height, preceded by a zero-height \hrule | No |
\vfill | Same as \vspace{\fill}; pushes the rest apart vertically | Yes |
\smallskip | A \vspace of 3pt plus 1pt minus 1pt | Yes |
\medskip | A \vspace of 6pt plus 2pt minus 2pt | Yes |
\bigskip | A \vspace of 12pt plus 4pt minus 4pt; about a line at 10pt | Yes |
\newlength, \setlength, \addtolength: lengths as variables
If the same length recurs all over a document, declaring one length register and referring to it by name is far easier to maintain. \newlength{\mylen} declares a new length, \setlength{\mylen}{2em} gives it a value and \addtolength{\mylen}{-1pt} adjusts it; change the value in one place and every use follows. The declaration happens once — running \newlength on the same name again produces ! LaTeX Error: Command \mylen already defined. To measure something you have actually typeset, \settowidth{\mylen}{Total:} (with \settoheight and \settodepth) stores the width that text really occupies. And \the\mylen prints the current value into the PDF whenever you want to check it.
Existing lengths can be used in the arithmetic directly: \textwidth (the width of the text block), \linewidth (the width of the line being set right now — narrower than \textwidth inside a minipage or a list), \baselineskip (the leading), \parindent (the indent) and \parskip (the gap between paragraphs, 0pt plus 1pt by default). Putting a factor in front scales them — 0.8\textwidth — and that works with no package at all. Here, though, is a trap that is nastier for producing no error. Without the calc package, \setlength{\mylen}{\textwidth - 2em} draws no complaint whatsoever. What happens is not a subtraction: \mylen receives plain \textwidth (345.0pt in a default article), and the leftover - 2em is typeset into the document as text. You find out when the string “- 2em” shows up in the PDF. Load \usepackage{calc} and the same line correctly yields 324.99997pt, and parenthesised expressions such as (\textwidth - 2em)/2 become available too.
\usepackage{calc} % needed for + - * / inside \setlength
% ...
\newlength{\gutter}
\setlength{\gutter}{2em}
\addtolength{\gutter}{-1pt}
\newlength{\halfcol}
\setlength{\halfcol}{(\textwidth - \gutter) / 2}
\newlength{\labelw}
\settowidth{\labelw}{Total:} % width of that text once typeset
\the\halfcol % prints the value, e.g. 162.49998pt
\noindent\hspace*{0.8\textwidth}right-aligned headingThree habits cover most of it in practice. Hard-coded values are the last resort: the moment you write 8cm, the proportion breaks as soon as the paper size or the margins change, whereas an expression built on an existing length — 0.8\textwidth, 2\baselineskip — survives the change. Prefer the ready-made \smallskip, \medskip and \bigskip to a raw \vspace{12pt}, and the whole document breathes consistently. And star only the space that genuinely has to survive a break, because space you left unstarred is space TeX has been told it may throw away. Follow those three and the mysterious “the gap is missing only here” bug mostly stops happening.