Tx · LaTeX & TikZ

What Is the LaTeX Command for an Em Dash?

Published By the 9to5Science editorial team

At a glance

  1. 1. Type three hyphens

    In ordinary text, enter three consecutive hyphens: ---.

  2. 2. Check dash length

    One hyphen makes a hyphen, two make an en dash, and three make an em dash.

  3. 3. Compile the example

    Use the sequence in text mode; no extra package is needed.

Advertisement

In ordinary LaTeX text, the standard way to get an em dash is to type three hyphens in a row: ---. TeX converts that sequence into one em dash in the typeset document. You do not need a special package or a separate command.

The dash sequences

TeX uses the number of consecutive hyphens to distinguish three common punctuation marks:

LaTeX inputResultName
--Hyphen
--–En dash
---—Em dash

The input characters are hyphens, but TeX recognizes the sequences and prints the corresponding dash glyph. This convention applies in text mode.

Minimal working example

Here is a complete document you can compile with a standard LaTeX installation. It needs no additional packages.

\documentclass{article}

\begin{document}
An em dash: words---more words.

An en dash: pages 10--12.
\end{document}

The first sentence prints an em dash between “words” and “more words”; the second prints an en dash between the page numbers. The spaces around the em dash are a matter of typographic style. The example puts no spaces around it, which is common in American English. Some style guides or languages prefer spaces or thin spaces; add those deliberately if your style requires them.

Common mistakes

  • Using two hyphens for an em dash: -- produces an en dash. Use --- for an em dash.
  • Typing a Unicode dash instead: The three-hyphen input is the portable traditional LaTeX method. Directly entering — may work with a Unicode-aware engine, but behavior can depend on the engine and font setup.
  • Putting the sequence in math mode: The dash convention is for text. If you need a dash inside a mathematical expression, use a text command or otherwise format the punctuation appropriately for the surrounding math.

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.