[Tex/LaTex] First time XeLaTeX UTF8 bibliography in TeXworks

bibliographiesxetex

I see people having various problems related to bibliographies in TEX.SE, but I cannot really benefit from answers, because I'm not sure how to use any bibliography let alone UTF8.

Could anybody paste a minimal working example citing a website and a tell how to compile it (it appears to be different than simply compiling a .tex)?

Edit: I realize how lame this thread looks, but I honestly could not find an exact tutorial, because it's either pdflatex, non-UTF8, not TeXworks or whatever people talking about…

Best Answer

Here is an example file, which requires biber, and can be compiled with xelatex. Use the following commands: xelatex <filename>.tex, biber <filename>.bcf, xelatex <filename>.tex --- where '<filename>' is whatever you called the example file. (Note I don't have complicated UTF8 needs for my bibliography, so I added one entry full of gibberish; but compare the junkentry input with the image given below to see that biber handles the material properly, whereas bibtex would choke and produce the wrong gibberish.)

\documentclass[12pt]{article}
\usepackage{fontspec}
\defaultfontfeatures{Ligatures=TeX}%
\usepackage{ebgaramond}
\usepackage[french,ngerman,italian,british]{babel}
\usepackage[strict=true]{csquotes}
\usepackage[backend=biber, babel=hyphen, style=authortitle]{biblatex}
\addbibresource{\jobname.bib}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@Article{congar1958,
  author =   {Congar, Y. M.-J.},
  title =    {\foreignlanguage{latin}{Quod omnes tangit ab
              omnibus tractari et approbari debet}},
  shorttitle = {Quod omnes tangit},
  journal =  {Revue historique de droit français et étranger},
  date =     1958,
  volume =   36,
  pages =    {210--259},
  series =   {4e sér.},
  hyphenation =  {french},
}
@InCollection{flueler1992,
  author =   {Flüeler, Christoph},
  title =    {Die Rezeption der \quotedblbase Politica`` des
              Aristoteles an der Pariser Artistenfakultät im
              13.\@ und 14.\@ Jahrhundert},
  shorttitle = {Die Rezeption der \quotedblbase Politica``},
  booktitle = {Das Publikum politischer Theorie im 14.\@ Jahrhundert},
  pages =    {127--138},
  date =     1992,
  editor =   {Miethke, Jürgen},
  location = {Munich},
  publisher = {R. Oldenbourg Verlag},
  series =   {Schriften des Historischen Kollegs, Kolloquien},
  number =   21,
  hyphenation =  {german}}

@Book{tocco1910,
  editor =  {Tocco, Felice},
  title =   {La Quistione della povertà nel secolo XIV
             secondo nuovi documenti},
  shorttitle = {La Quistione},
  publisher = {Francesco Perrella},
  date =    1910,
  location = {Naples},
  hyphenation = {italian},
}

@Book{junkentry,
  author =      {Zߧœíáßó¼¾j},
  title =       {A «Fake» þíþøé},
  date =        9999,
  location =    {Nusquama},
  publisher =   {Apud nullum - ¥ - óé®jgððj§ØŒG®Ír},
}
\end{filecontents}

\begin{document}
\nocite{*}
\printbibliography
\end{document}

For those who'd like to stick with the pdfTeX engine (and thereby use latex or pdflatex), just comment out the \usepackage{fontspec} and defaultfontfeatures{Ligatures=TeX} lines, and load fonts and encodings in your accustomed way. For example, the following image was made with pdflatex and the following packages instead of fontspec:

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

enter image description here

Related Question