The main ways to add space in LaTeX

LaTeX gives you several commands to add space between text, and which one you use depends on what kind of space you need. Horizontal space (between words or elements on the same line) uses different commands than vertical space (between paragraphs or sections). The most common commands are \hspace{} for horizontal gaps, \vspace{} for vertical gaps, and \\ or \newline for line breaks.

The key difference is that LaTeX normally ignores extra spaces you type in your source code — it treats multiple spaces as one space. This is why you need explicit commands to create gaps. Understanding which command does what will save you time when your document layout isn't matching what you want.

Key Takeaways

  • \hspace{1cm} adds horizontal space on the same line, and you can use cm, mm, in, or pt as your unit of measurement.
  • \vspace{1cm} adds vertical space between lines or paragraphs, but it is ignored at the top of a page unless you use \vspace*{} with an asterisk.
  • \\ creates a line break and moves text to the next line, while \newline does the same but respects paragraph formatting.
  • \quad and \qquad add fixed-width spaces relative to the current font size, useful for consistent spacing without measuring.
  • Spacing commands work differently in math mode, where you need \,, \:, and \; instead of the regular commands.

Horizontal spacing: adding gaps between words and elements

\hspace{} is the straightforward way to add space horizontally. You put the amount inside the curly braces: \hspace{0.5cm} adds half a centimeter, \hspace{1in} adds one inch. You can use centimeters (cm), millimeters (mm), inches (in), or points (pt). The space appears exactly where you type it in your source code.

If you need space that stretches to fill available room, use \hfill. This is useful when you want text pushed to opposite ends of a line — for example, a name on the left and a date on the right. Type the first item, then \hfill, then the second item, and LaTeX spreads them apart to fill the line width.

\quad and \qquad add space based on the current font size rather than a fixed measurement. One \quad equals the width of the letter "M" in your current font; \qquad is two quads. These are useful when you want spacing that scales with your font instead of staying the same size if you change fonts later.

Vertical spacing: gaps between lines and paragraphs

\vspace{} adds space vertically, the same way \hspace{} works horizontally. Type \vspace{0.5cm} to add half a centimeter of vertical space. The space appears where you type it — usually at the end of a line or between paragraphs.

One important quirk: \vspace{} is ignored if it appears at the very top of a page. If you need space that works even at the top of a page, use \vspace*{} with an asterisk instead. This is common when you want consistent spacing before a section heading that might fall at the page break.

For spacing between paragraphs throughout your document, you can also adjust the \parskip length in your preamble. Adding \setlength{\parskip}{0.5cm} before \begin{document} makes every paragraph break add that much space automatically, rather than typing \vspace{} each time.

Line breaks and paragraph breaks

\\ creates a line break and moves the next text to a new line without starting a new paragraph. This is useful inside tables, lists, or when you want text on separate lines but still part of the same paragraph. You can also use \\[0.5cm] to add extra vertical space after the line break.

\newline does the same thing as \\ but respects paragraph indentation and formatting rules more strictly. In most cases, \\ is simpler, but \newline is safer inside certain environments like lists or boxes where \\ can cause unexpected behavior.

To start a completely new paragraph with a blank line between, just press Enter twice in your source code (or leave a blank line). LaTeX treats blank lines as paragraph breaks and adds the spacing you set with \parskip or the default paragraph spacing.

Spacing in math mode

Math mode — the space between dollar signs like $x + y$ — uses different spacing commands. Regular \hspace{} and \vspace{} do not work inside math mode. Instead, use \, for a thin space, \: for a medium space, and \; for a thick space.

These math-mode spaces are relative to the font size, so they scale if you change font sizes. If you need to add regular text (not math) inside a math expression, wrap it in \text{} first, then add spacing around it. For example: $x \text{ meters} \; y$ puts text and spacing inside the math expression correctly.

Common spacing measurements and when to use them

LaTeX accepts several units of measurement. Centimeters (cm) and inches (in) are intuitive if you think in those terms. Points (pt) are used in typography — 72 points equals one inch. Millimeters (mm) are useful for precise small adjustments. You can also use em (the width of the letter "M") or ex (the height of the letter "x"), which scale with your font size.

For most documents, centimeters or inches work fine. If you are adjusting spacing to match a specific format or template, check what unit the original uses. Relative units like em are better for documents you might reformat later, because the spacing adjusts automatically if you change font sizes.

Troubleshooting spacing that does not appear

If you add \vspace{} and nothing happens, check whether it is at the top of a page — use \vspace*{} instead. If \hspace{} is not showing up, make sure there is text before and after it; LaTeX sometimes ignores horizontal space at the start or end of a line.

Another common issue: spacing inside tables or special environments. Tables, lists, and boxes have their own spacing rules that can override your \vspace{} or \hspace{} commands. In these cases, look for environment-specific options like \arraystretch for tables or \itemsep for lists.

If you are using a document class that sets its own spacing (like a journal template), those settings may override your manual spacing. Check the class documentation or look for \setlength commands in the preamble that control spacing globally.

Frequently Asked Questions

What is the difference between \\ and \newline?

\\ is a line break that works almost everywhere and is faster to type. \newline is more formal and respects paragraph rules more strictly. In most cases, \\ works fine. Use \newline if \\ causes unexpected spacing or formatting inside lists or special environments.

Why does \vspace not work at the top of a page?

LaTeX removes vertical space at page breaks to keep pages aligned. If you need space at the top of a page, use \vspace*{} with an asterisk instead — the asterisk tells LaTeX to keep the space even at page boundaries.

Can I use negative space to remove gaps?

Yes. \hspace{-0.5cm} or \vspace{-0.5cm} with a negative number pulls text closer together. This is useful for fine-tuning spacing, but use it sparingly — too much negative space makes text overlap and become unreadable.

How do I add space inside a table cell?

Use \\ to create line breaks within a cell, or adjust \arraystretch in the preamble to add space between all rows. For space around text inside a cell, add \hspace{} or \vspace{} before or after the text, or use padding commands specific to your table package.

What is the difference between \quad and \hspace?

\quad adds space based on font size (the width of the letter "M"), so it scales if you change fonts. \hspace{} uses fixed measurements like centimeters. Use \quad when you want spacing that adjusts with your font, and \hspace{} when you need exact measurements.