332

How to write in bibliography (package natbib) letter "a" with two dots above? Specially, I mean the word Birkhäuser.

Is there a general rule or way how to write such umlauts or other accented letters in bibliographies?

  • 8
    The symbol is called an umlaut a – Caramdir May 29 '12 at 16:43
  • 6
    @Jane I extended the scope of your (good!) question a bit to cover other such letters, hope you don't mind. We do this here occasionally to make questions "canonical". – doncherry Jul 18 '12 at 14:17
445

To typeset accented characters inside bibliography fields for processing with BibTeX, encase them in curly braces. To list but a few accented characters:

{\"a} {\^e} {\`i} {\.I} {\o} {\'u} {\aa} {\c c} {\u g} {\l} {\~n} {\H o} {\v r} {\ss}

enter image description here

The word Birkhäuser should therefore be entered as Birkh{\"a}user.

Just to provide a somewhat more involved case: the name Jaromír Kovářík should be entered as either Jarom{\'i}r Kov{\'a}{\v r}{\'i}k or, more succinctly, Jarom{\'i}r Kov{\'a\v r\'i}k. As is explained in greater detail below, BibTeX will then sort the surname Kovářík as if it were spelled Kovarik, i.e., without any "accented characters". Replacing the accented characters in Kovářík with unaccented characters matters if the bibliography's entries are sorted alphabetically by authors' surnames and if the bibliography contains entries with the surnames Kovářík, Kovács, Kowalski, and Kowatski...


Addendum: There is an obvious follow-up question to the "How does one enter a special character for use in BibTeX?" question: Why is it necessary to encase these "special characters" in this manner? Or: Why are the ordinary methods of entering these characters in a LaTeX document -- say, \"{a} or \"a, let alone ä -- not quite right for BibTeX?

There are two separate reasons for this requirement.

  1. If you use double-quotes, i.e., " ... ", to delimit the contents of a bibliographic field, you will find that writing

    author = "Anna H\"{a}user",
    

    generates a BibTeX error, whereas

    author = "Anna H{\"a}user",
    

    does not. I.e., BibTeX isn't quite smart enough on its own to distinguish between the two uses of the " character and needs extra help.

  2. In addition, contents of bibliographic fields -- certainly the author and editor fields, but potentially other fields as well, including the title, booktitle, and organization fields -- are frequently used to sort entries alphabetically.

    How do BibTeX (and LaTeX) sort characters with Umlaute, diacritics, and other special features relative to the basic 26 characters of the Latin alphabet? How is one supposed to sort three authors named, say, Peter Hauser, Anna Häuser, and John Hill? For some pretty sound reasons -- but which are way too ancient and obscure to go into any adequate level of detail here; to explore these reasons properly, it's crucial to have Appendix C of the TeXBook handy... -- a decision was made in the design of BibTeX to "purify" (the BibTeX function that does this job really is called purify$!) the contents of various fields as follows (this method conforms, probably not surprisingly, to US and UK sorting criteria; it needn't be "correct" outside of English-speaking regions, as I will note below) for sorting purposes:

    • {\"a}, {\'a}, {\^a}, etc are all made equivalent to a,
    • {\"o}, {\'o}, {\H o} and {\o} are all made equivalent to o,
    • {\l} and {\L} become equivalent to l and L, respectively,
    • {\ss} becomes equivalent to ss,
    • {\aa} becomes equivalent to aa,
    • and so on for all other "accented" characters,
    • finally, any characters that do not fit into this scheme, including ä, are moved to the very end, i.e., after z. This may seem arbitrary and ill-informed from today's vantage point, but back when BibTeX was created more than 20 years ago the only relevant character encoding and sorting system was ASCII.

    As you can immediately appreciate, this "purification" step is greatly simplified and made more robust if the "accented" characters are all entered consistently in the manner suggested in the first part of this answer.

    Turning to the earlier case of the three authors named Peter Hauser, Anna Häuser, and John Hill: How will they appear in a bibliography whose entries are sorted alphabetically by the authors' surnames? If Anna's last name is entered as H{\"a}user, the three authors will end up being listed as Häuser, A. - Hauser, P. - Hill, J.. In contrast, if Anna's last name had been entered as Häuser, the sorting order would have been Hauser - Hill - Häuser. For most English-speaking readers, the second ordering will look completely wrong.

Some specialists from, say, Sweden, may object that this approach to sorting characters that aren't among the basic 26 characters of the Latin alphabet doesn't meet the specific national standards of, say, Sweden. [I obviously don't mean to pick on any Swedes. I mention them because I remember having read somewhere that in the Swedish alphabet, ä does come after z and hence is definitely not equivalent (not even for sorting purposes!) to a.] My answer to this objection is: If you're a Swedish author writing in Swedish for a Swedish target audience, you had better conform to specific Swedish customs. On the other hand, if you're a Swede writing in English in a journal that's exclusively published in English, it'll do you no good at all if you try to insist on obeying Swedish sorting customs in your paper's bibliography. Of course, the very inability of BibTeX to be easily adaptable to non-English sorting customs is one of the reasons for the development and adoption of BibLaTeX and Biber. However, that's a topic for another day, isn't it?

The issue of how BibTeX sorts bibliographic entries (as well as many other fascinating [!] issues) is examined at length and explained admirably in the surprisingly readable (given the enormous dryness of the subject!) essay Tame the BeaST by Nicolas Markey. If you have TeXLive or MikTeX as your TeX distribution, you can also access this document by typing "texdoc tamethebeast" at a command prompt.


For the sake of completeness and replicability, here's the MWE that gives to the screenshot shown above. Note that it's not necessary to load any extra packages to typeset the accented characters considered in this example. However, assuming you use pdfLaTeX to compile your document, you will need to load the fontenc package with the option T1 if you need to typeset, say, an ogonek-accented character, such as {\k a}, or the Icelandic "thorn", {\th}.

\documentclass[border=1pt]{standalone}
\begin{document}
{\"a} {\^e} {\`i} {\.I} {\o} {\'u} {\aa} {\c c} {\u g} {\l} {\~n} {\H o} {\v r} {\ss}
\end{document} 
  • 1
    I expanded the scope of the question, but as far as I can see, your answer covers it all already. – doncherry Jul 18 '12 at 14:19
  • 2
    @Mico: Where would I find a comprehensive list of all character macros and their unicode equivalents? – krlmlr Jul 19 '12 at 18:32
  • 1
    @Mico: Done. tex.stackexchange.com/q/64009/8057 – krlmlr Jul 20 '12 at 1:45
  • 6
    Great answer. Completely correct about the Swedish usage of å, ä, and ö (they come after z). – jocap Aug 22 '13 at 19:11
  • 1
    @Mico Learner's Q: could you show me with an example where Dror's answer fails while using bibtex, When i run it with bibtex the ouput gave accentuated characters with utf8 inputencoding – texenthusiast Feb 19 '14 at 13:41
50

When using \usepackage[utf8]{inputenc} you can have it directly.

Consider the following .bib file:

@BOOK
  {Goe,
   AUTHOR  = "Gödel",
   TITLE   = "Die Vollständigkeit der Axiome des logischen Funktionenkalküls.",
   PUBLISHER = "Monatshefte für Mathematik und Physik",
   YEAR = 1930
  }

for example. Then

\documentclass{article}
\usepackage[utf8]{inputenc}

\begin{document}
\bibliographystyle{plain}

\section{Introduction}
Hällo Wörld\cite{Goe}

\bibliography{encodingInBib}

\end{document}

yields the desired result. Or, you could also use biblatex and the following code:

\documentclass{article} 
\usepackage[utf8]{inputenc}
\usepackage{biblatex} 
\bibliography{ref}
\begin{document} 
Hällo Wörld\cite{Goe} 
\printbibliography
\end{document}

In the final result, using either method, the umlauts are inserted automatically.

  • 9
    You may want to state a bit more prominently that this method requires the use of biblatex. The OP provided the tag "bibtex" rather than "biblatex", and hence it may be worth pointing out your method's requirement explicitly. – Mico May 30 '12 at 9:58
  • 6
    @Dror: bibtex won't sort this correctly (Gödel should be sorted as Godel). – Caramdir May 30 '12 at 19:37
  • 5
    @Caramdir: Depends on the language, in Finnish, for example, it wouldn't be sorted that way. – morbusg Jul 18 '12 at 14:25
  • 4
    @morbusg - I guess Caramdir was assuming implicitly that the publication in question is written in English for an English language speaking target audience. For someone accustomed to English-language sorting rules, it would look very wrong indeed (and probably downright weird as well) to see Gödel sorted after, say, Gyntelberg. – Mico Jul 19 '12 at 11:35
  • 7
    @SubhamoySengupta For XeLaTeX just encode the documents in utf8 and make sure you load fontspec so you get a font that has the accented characters, e.g. \usepackage{fontspec} will be enough, as this loads lmodern. – Andrew Swann Jan 3 '14 at 10:43
0

In my case, this is what worked for me:

\usepackage[T1]{fontenc} 

This package uses 8-bit encoding that has 256 glyphs covering the letter you mentioned (and much more)

  • 3
    The question is about the input, not the font. – Johannes_B Jan 28 '18 at 9:26
  • I agree, but when I tried the package mentioned in the other answer, it did not resolve my issue. This package did. If you think my answer is not relevant/related to the question, please let me know so that I delete it. – Billal Begueradj Jan 28 '18 at 9:29
  • 1
    Loading the fontenc and inputenc packages (with suitably chosen options) will help on the LaTeX side of things. However, it does nothing on the BibTeX side of things. The current query is about how accented characters should be entered so that they'll get processed correctly by BibTeX; here, "processed correctly" includes sorting. As I wrote in my answer, in your setup, "Anna Häuser" would get sorted after "Brent Hauser". That goes against well-established (English language) sorting conventions, in which Häuser and Hauser are equivalent, so that "Anna" should come before "Brent". – Mico Mar 14 '18 at 16:35
0

I don't know if this will apply here, but in my case, I use Zotero to produce my bib file. I had trouble exporting it with accents and I didn't want to go through all the articles to write the accents as proposed in the answer.

I found that exporting the BibTeX file with character encoding as "Unicode (UTF-8 withou BOM)" worked, instead of "Unicode (UTF-8)". Now I can add new articles and export them without a problem!

  • While this approach may appear to "work", in the sense that Zotero now outputs something that is handled correctly by BibTeX and/or LaTeX, it doesn't address the issue of what do with non-ASCII characters such as ä, ö, é, and è if they occur in fields relevant for sorting. E.g., if your bibliography has two entries, authored by Anna Häuser and Peter Hauser, respectively, then your approach will lead BibTeX to place the Hauser entry before the Häuser entry. If your document is written in English, this ordering would be deemed wrong because "Peter" should come after "Anna". – Mico Jun 2 '18 at 5:18
-1

I used Mendeley as my .Bib generator, just check the "Escape LaTeX special characters(#{}%& etc.)" on the Mendeley > Tools > Option > 'BibTeX' tabs.

Then back to the LaTeX, recompile and done.

  • Welcome to TeX.SE. Unfortunately, your answer is wrong, for two separate reasons. First, it doesn't actually address the question, which was about entering "accented" characters such as ä, ö, é, è, and ß. The question was not about characters, such as #, %, and &, which are "special" to TeX. Second, it's wrong to escape characters such as % and & if they occur in a URL string, as escaping these characters would change the actual URL strings. URL strings should be either encased in a \url{...} "wrapper" or occur in a field called url, so that no escaping is needed. – Mico Jun 2 '18 at 5:04
  • The queries and answers posted on TeX.SE are frequently brought up in Google searches, and many readers rely heavily (and possibly uncritically) on the answers they find here. That's why it's important to be precise in one's answers. I certainly hope that you didn't perceive my comments to be harsh. You are definitely very welcome to post more answers in the future. – Mico Jun 3 '18 at 6:45
  • Thanks sir, I understood. I've been being a silent reader for a long time, but then I found the solution but it was a mistake that my solution isn't the proper answer for this problem. So I need to adapt this kind of situation, because its uncommon situation for me to answer on this TeX.SE. – Jaler Sekar Maji Jun 4 '18 at 7:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.