Special Characters in LaTeX and BibTeX
This page covers special characters in LaTeX and BibTeX: the reserved characters that must be escaped, accents and umlauts, Unicode, and how to stop bibliography styles from changing your capitalization.
On this page
BibTeX fields contain LaTeX. BibTeX copies them into the bibliography and LaTeX typesets them, so everything on this page applies both to the text of a LaTeX document and to the fields of a .bib file. Where BibTeX adds rules of its own, this is noted.
Characters that need escaping
LaTeX reserves ten characters for its own syntax: # $ % & _ { } ~ ^ \. To print one of them, write it as shown here:
| Character | Write | Note |
|---|---|---|
| & | \& |
Otherwise the column separator in tables. Very common in journal and publisher names |
| % | \% |
Otherwise starts a comment, and the rest of the line disappears |
| $ | \$ |
Otherwise starts math mode |
| # | \# |
Otherwise a macro parameter. Between field values, BibTeX’s concatenation operator |
| _ | \_ |
Otherwise a subscript, which is only allowed in math mode |
| { } | \{ \} |
Otherwise group delimiters. In a .bib file, braces must be balanced even when escaped |
| ~ | \textasciitilde{} |
A plain ~ is a non-breaking space. In math: \sim |
| ^ | \textasciicircum{} |
Otherwise a superscript, which is only allowed in math mode |
| \ | \textbackslash{} |
Otherwise starts a command. \\ is a line break, not a backslash |
| “ | {"} |
Only in .bib values delimited by quotes, where a bare " ends the value |
| < > | | \textless{} \textgreater{} \textbar{} |
Only with pdfLaTeX’s default font encoding, which prints ¡ ¿ — instead. Not needed with \usepackage[T1]{fontenc} |
journal = {Astronomy \& Astrophysics}
title = {A 10\% Improvement for under \$5}
publisher = {Simon \& Schuster}
URLs are the exception: in url fields, and inside \url{...}, write them exactly as they are. The url and hyperref packages take care of special characters.
In a .bib file, the @ sign needs no escaping inside a field value, and % does not start a comment as far as BibTeX is concerned, see comments in .bib files.
Accents and umlauts
In a LaTeX document you can type accented characters directly, since UTF-8 is the default input encoding. In a .bib file for classic BibTeX, write the accent command and put the whole command in braces, like {\"o}. BibTeX then treats it as a single letter when it sorts entries, changes the case of titles and abbreviates first names.
author = {G{\"o}del, Kurt and Erd{\H{o}}s, Paul}
title = {Na{\"\i}ve Set Theory, {\'E}tudes, and {\AA}ngstr{\"o}m Units}
The commonest cases:
| Command | Result | Command | Result |
|---|---|---|---|
{\"a}, {\"o}, {\"u} |
ä, ö, ü | {\ss} |
ß |
{\'e}, {\`e}, {\^e} |
é, è, ê | {\c{c}} |
ç |
{\~n} |
ñ | {\v{s}} |
š |
{\o}, {\aa}, {\ae} |
ø, å, æ | {\l} |
ł |
LaTeX Accents and Umlauts has the complete list: every accent command, all special letters, a letter-by-letter table and accents in math mode.
Unicode
With biblatex and biber, you can type the characters in UTF-8: author = {Gödel, Kurt}. The same works with classic BibTeX in most modern setups, since LaTeX reads UTF-8 by default. However, BibTeX itself doesn’t understand multi-byte characters. It may sort them wrongly, and styles that abbreviate first names or build labels can cut them in half. If you depend on classic BibTeX, the LaTeX commands above are the safest choice.
Protecting capital letters
Many styles change titles to sentence case, so An Introduction to BibTeX becomes An introduction to bibtex. Text inside an extra pair of braces is left exactly as written:
title = {An Introduction to {BibTeX}}
title = {Bayesian Methods for {DNA} Sequencing in {Europe}}
Brace single words or acronyms rather than the whole title. That way the style can still apply its own capitalization to everything else. Wrapping the whole title in double braces ({{...}}) works, but it hides the title from the style entirely.
LaTeX commands and math
Fields may contain LaTeX commands, which are processed when the bibliography is typeset. For example, \emph, \textsc or \TeX:
title = {The {\TeX}book}
title = {Clustering in \emph{Drosophila} Genomes}
title = {The $20^{th}$ Annual Meeting of {BibTeX} Users}
title = {Improved Bounds for the ${O}(n \log n)$ Case}
A command with capital letters in its name, such as \TeX, needs braces around it. Otherwise a sentence-case style turns it into \tex, which LaTeX doesn’t know. The argument of a command, as in \emph{Drosophila}, is protected by its own braces. Don’t add a pair around the whole command: BibTeX lowercases the text inside a group that starts with a backslash, so {\emph{Drosophila}} is printed as drosophila. Math mode works as usual; put upper-case letters in formulas in braces too, or $O(n)$ becomes $o(n)$.
Symbols that are not on the keyboard have commands as well, for example \S (§), \copyright (©), \pounds (£), \texteuro (€), \dots (…) and -- for the en dash in page ranges.