Skip to content
Tutorials Center
My learning

Topics

Lesson 9 of 38 · Documents and Text Formatting

Special Characters, Accents and Symbols

Type reserved characters, accented letters, ligatures, dashes, currency and text symbols in LaTeX, and learn how UTF-8, textcomp and the Unicode engines change the rules.

LaTeX's source file uses a small alphabet of characters. Ten of them are reserved, and everything else, from accented letters to the euro sign, is either typed directly (with UTF-8 input) or written as a command. This lesson is the reference for printing the characters that do not just work when you type them. Combined with the whitespace and escape rules, it removes most of the first-week error messages.

Reserved characters

A quick recap, with the extra details you need when the characters appear inside text.

Print Source Notes
# \#
$ \$
% \%
& \&
_ \_ \textunderscore also works
{ } \{ \} In math mode
~ \textasciitilde Or \~{}
^ \textasciicircum Or \^{}
\ \textbackslash
< > \textless, \textgreater In T1 encoding you can type them directly

Typing $ or _ by accident is the most common source of "Missing $ inserted" errors. When you must write many such characters, for example a path or a URL, use \texttt{\detokenize{...}}, the \url{...} command from the url or hyperref package, or the verbatim tools you saw in the text formatting lesson.

Accented letters

If your editor saves the file as UTF-8 (all modern ones do), you can type accented letters as they are: é, ü, ñ, ç. Current LaTeX versions read UTF-8 by default. For correct hyphenation and copy-and-paste from the PDF with pdfLaTeX, add the font-encoding package:

LATEX
\usepackage[T1]{fontenc}

The classic command forms still work everywhere and appear in older documents and in files that must be pure ASCII:

Accent Command Example Result
acute \' \'e é
grave \` \`a à
circumflex \^ \^o ô
umlaut \" \"u ü
tilde \~ \~n ñ
macron \= \=a ā
dot above \. \.z ż
breve \u \u{a} ă
caron \v \v{s} š
cedilla \c \c{c} ç
ring \r \r{a} å
double acute \H \H{o} ő
tie \t \t{oo} o͡o

Letter-named accents (\u, \v, \c, \r, \H) need the argument in braces or a space after the command. The dotless letters \i and \j exist because an accent on a normal i would collide with its dot: write \'{\i} for í.

Letters that are not accents

Result Command
ø Ø \o \O
å Å \aa \AA
æ Æ \ae \AE
œ Œ \oe \OE
ł Ł \l \L
ß \ss
¿ ¡ ?` and !`
ı (dotless i) \i

The inverted marks are ligatures: a question mark or exclamation mark followed by a backtick prints the inverted one.

Try the standard commands in the stand-in below. It converts a handful of accent commands and letters to their Unicode characters so you can see which source produces which result. The real work, choosing glyphs from the font, is done by LaTeX.

Accent commands to characters (stand-in)

Ligatures, dashes and quotes

LaTeX automatically joins some letter pairs into ligatures: "fi", "fl", "ff", "ffi" print as single glyphs. This looks right in normal words. To prevent one across a morpheme boundary (for example in a compound such as "shelf-ful"), insert {} or \/ between the letters: shelf{}ful.

Dashes are made of hyphens in the source: - for a hyphen (re-use), -- en dash for ranges (1990--2000), --- em dash. In math mode, a hyphen becomes a minus sign.

Quotes: double'' and single' `` as described earlier. The csquotespackage offers\enquote{...}`.

Symbols for text

Many symbols exist as text commands. Some need the textcomp package (loaded automatically in current LaTeX releases).

Result Command Result Command
© \copyright ® \textregistered
™ \texttrademark § \S
\P † \dag
‡ \ddag • \textbullet
€ \texteuro (or eurosym) £ \pounds
° \textdegree ± \textpm
× \texttimes ÷ \textdiv
… \ldots ‰ \textperthousand

For math symbols use math mode instead; the math symbols lesson lists hundreds.

Large symbol sets

When you need arrows, checkmarks, music notes, astronomy signs or social-media logos, load a dedicated package: fontawesome5 for icons, pifont for the classic Dingbats (\ding{51} is a check mark), marvosym, wasysym, or bbding. Each provides commands such as \faGithub or \checkmark (from amssymb). Look at the package's PDF with texdoc to find the symbol table.

Unicode: pdfLaTeX versus XeLaTeX and LuaLaTeX

  • pdfLaTeX reads UTF-8 but only supports characters it has been told about through the inputenc/fontenc machinery. A Greek or Chinese letter typed directly triggers "Unicode character ... not set up for use with LaTeX".
  • XeLaTeX and LuaLaTeX accept almost any Unicode character directly, provided the chosen font has it. For other scripts load fontspec and select a font that covers the script. polyglossia or babel select hyphenation and language rules.
LATEX
% compile with xelatex or lualatex
\usepackage{fontspec}
\setmainfont{Noto Serif}
\setsansfont{Noto Sans}
Greek: Ελληνικά.  Cyrillic: Привет.

For documents in a single Western language, babel with a language option also translates built-in names such as "Contents" and "Figure":

LATEX
\usepackage[german]{babel}

Practical tips

  • If a file name or URL contains _ or %, wrap it in \url{...} instead of escaping each one.
  • Use \textbackslash for a backslash in prose; the \\ command is a line break, not a backslash.
  • A missing symbol in a font prints a blank or a warning like "Missing character". Switch the font or the package.
  • Keep source files in UTF-8 without BOM. Check the editor's status bar for the encoding.

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. How do you print the percent sign?

    An unescaped % starts a comment.
  2. 2. What produces the letter é with a command?

    ' is the acute accent; ^ is circumflex, \c cedilla, \v caron.
  3. 3. Which engine accepts Unicode text in a font of your choice most easily?

    The Unicode engines read and typeset Unicode directly and load system fonts.
  4. 4. What does the source --- (three hyphens) print?

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

Summary

  • Escape # $ % & _ { } with a backslash; ~ ^ \ need text commands.
  • UTF-8 input plus fontenc handles most accents; classic commands (\'e, \"u, \c{c}) still work.
  • Special letters have names (\ss, \o, \ae); symbols like \copyright and \texteuro print in text mode.
  • Dashes are written with one, two or three hyphens.
  • XeLaTeX and LuaLaTeX with fontspec are the choice for other scripts.

Next: Math Modes: Inline and Display Formulas