Your support for our advertisers helps cover the cost of hosting, research, and maintenance of this document

Formatting Information — An introduction to typesetting with LATEX

Chapter 1: Writing documents

Section 1.8: Accents

For accented letters in Latin-alphabet languages, use the accented keys on your keyboard. If you don’t have any, use your computer’s or editor’s character map (usually under the InsertSpecial Characters menu) to pick them from the pop-up window.

  • If you are using XƎLATEX, no further configuration needed, as XƎLATEX handles UTF-8 characters by itself;

  • If you are using PDFLATEX with BIBTEX you MUST always start your Preamble with these two lines to handle accents and other UTF-8 characters:

    \usepackage[utf8x]{inputenc}
    \usepackage[T1]{fontenc}
    	  
  • If you are using PDFLATEX with biblatex/biber, you MUST do the same, but use the utf8 option (no x) instead of utf8x:

    \usepackage[utf8]{inputenc}
    \usepackage[T1]{fontenc}
    	  

That takes care of telling LATEX what character repertoire (inputenc, the input encoding) your system is using, and which set of fonts (fontenc, the ‘font encoding’) to find the extra characters in. XƎLATEX needs no telling, except for one extra package for font-handling (see the listitem ‘If you are using XƎLATEX, no …’).

You also need to make sure your computer’s operating system is set to UTF-8, and that your editor is set the same way. Most are — with most modern systems, Unicode compatibility will let you use almost any letter or symbol from any writing system encoded in UTF-8 (the multibyte 8–bit encoding), for which LATEX has extensible support.

For language-specific hyphenation and cultural adaptation (including the correct language headings for all the parts of your document) use the babel package (see § 1.9.6). For non-Latin typefaces you will also need the relevant font packages and typefaces (see § 6.2).

Failing all this, if you don’t have accented letter keys on your keyboard, or you can’t find the codes to type, or if you need additional accents or symbols which are not in any of the keyboard tables, you can use the symbolic notation in Table 1.2. In fact this can be used to put any accent over any letter (Welsh users can get a ŵ with \^w), even for combinations which don’t actually exist in any language: if you particularly want a g̃, for example, you can have one with the command \~g.

If you use this symbolic method only, you do not need to use the inputenc package described above.

Table 1.2: Symbolic notation for accents

AccentExampleCharacters to type
Acute (fada)é\'e
Graveè\`e
Circumflexê\^e
Umlaut or diæresisë\"e
Tildeñ\~n
Macronō\=o
Bar-undero\b o
Dot-over (séıṁıú)\.m
Dot-under\d s
Breveŭ\u u
Háček (caron)ŭ\v u
Long umlautő\H o
Tie-afteroo\char"0361\t oo
Cedillaç, Ç\c c, \c C
O-E ligatureœ, Œ\oe, \OE
A-E ligatureæ, Æ\ae, \AE
A-ringå, Å\aa, \AA
O-slashø, Ø\o, \O
Soft-lł, Ł\l, \L
Ess-zet (scharfes-S)ß\ss

Before the days of keyboards and screens with their own real accented characters, the symbolic notation was the only way to get accents, so you may come across a lot of older documents (and users!) using this method all the time: it does have the advantage in portability that the LATEX file remains plain ASCII, which will work on all machines everywhere, regardless of their internal encoding, and even with very old TEX installations.

Irish and Turkish dotless-ı can be done with the special command \i, so an í (which is normally typed with í) may require \'\i{} if you need to type it in the long format — remembering that dummy pair of curly braces if there is no punctuation, because of the rule that LATEX control sequences which end in a letter (see § 1.5.1) always absorb any following space. So what you might see as Rí Teaṁraċ would have to be R\'\i\ Tea\.mra\.c when typed in full (there are not usually any dedicated keyboard keys for the dotless-ı or for aspirated or lenited characters). A similar rule applies to dotless-ȷ and to uppercase Í.

Note that modern versions of LATEX can compensate for this when used with the utf8x option of the inputenc package and the T1 option of the fontenc package (as shown above). In that case you can just type f\'is to get ‘fís’. If you use XƎLATEX you don’t even need those packages and options, and you just type ‘fís’.

  1. Remember not everyone is lucky enough to be able to install new software: many users on business and academic networks still use old versions of TEX because they or their system managers don’t know how to update them. Local user groups may be able to provide help and support here.