6

I've one problem in my scrbook, ï and î don't work when I compile my \printbibliography. But the problem come only with these 2 accents…

Begin of my bibliography

I export my .bib from Papers2 for Mac application, & I use TexShop, UTF8 encoding, & I'm newbie with Biber & Biblatex.

Please help ! Thank you.

My ref :

@book{GoncalvesdaCosta:2000tw,
author = {Goncalves Da Costa, H{\'e}lo{\"\i}sa},
title = {{Les mus{\'e}es d'histoire de ville leur contribution au d{\'e}veloppement social contemporain.}},
publisher = {Universit{\'e} du Qu{\'e}bec {\`a} Montr{\'e}al},
year = {2000},
address = {Montr{\'e}al}}

My minimal config :

% !TEX encoding = UTF-8 Unicode
\documentclass[12pt]{scrbook}

\usepackage[english,frenchb]{babel}             
\usepackage[quiet]{fontspec}    

\usepackage[automark]{scrpage2}
\usepackage[babel,french=guillemets*]{csquotes} 
\usepackage[backend=biber,style=authortitle-ticomp,doi=false]{biblatex}

\frenchbsetup{FrenchFootnotes=false}
\MakeOuterQuote{"}

\setmainfont[Mapping=tex-text, Ligatures={Common, Rare}, Numbers={OldStyle}]{Adobe Garamond Pro}

\addtokomafont{disposition}{\normalfont}
\addtokomafont{pageheadfoot}{\normalfont}       
\addtokomafont{pagenumber}{\normalfont} 
\addtokomafont{footnote}{\normalfont}               
\addtokomafont{footnotereference}{\normalfont}

\addbibresource{Biblio.bib}             
\AtBeginBibliography{\def\UrlFont{\scriptsize}}

\begin{document}
"Héloïse"\footcite{GoncalvesdaCosta:2000tw}.
\printbibliography
\end{document}
Mico
  • 506,678
Zouib
  • 857

2 Answers2

9

With LuaTeX the glyph isn't available for Garamond Regular. I tried it with the Garamond Pro and Garamond Premier Pro. Only the italic and bold variant show the character. But EBGaramond has it:

enter image description here

If I run the example with xelatex instead of lualatex then everything is fine with AGaramondPro, too:

enter image description here

As Enrico said, use another font if you do not have the EBGaramond, at least for the bibliography. However, you can write your bibliography with unicode characters:

@book{GoncalvesdaCosta:2000tw,
author = {Goncalves Da Costa, Héloïsea},
title = {Les musées d'histoire de ville leur contribution au développement social contemporain.},
publisher = {Université du Québec à Montréal},
year = {2000},
address = {Montréal}}

Biber can handle all that.

  • However, you can write your bibliography with unicode characters:...Biber can handle all that. Is true, if and only if you don't need bibtex back-compatibility in your .bib file, see for example this question and its answers – Chris H Feb 04 '14 at 16:57
  • 1
    that's obvious! BibTeX is a 7-bit-System! –  Feb 04 '14 at 17:00
  • It's obvious once you know a bit of the history of bibtex, which can't be assumed! – Chris H Feb 04 '14 at 17:02
  • without history nobody knows what this might be: {\"i} –  Feb 04 '14 at 17:03
  • EBGaramond is part of the default installation of TeX Live, at least, in both postscript and opentype formats. So if you don't have it, it should be pretty easy to get. – cfr Feb 04 '14 at 17:18
  • Thank you @Herbert @Chris-H & @cfr for your help, but I think my question isn't really solved because AGaramondPro give me indeed the good glyphe in my text (with this to ways: ï& {\"\i}) but not in my .bib {with ï yes, but not with {\"\i}}. The problem persist with other fonts… So, I moved yesterday to biber & I imagine that the problem appeared at that point from encoding migrations. – Zouib Feb 04 '14 at 17:57
  • I'm writing my phD & I upgrade every day my bibliography from Papers2, I can't always change by hand. I give you some cmd lines when I compile with biker : INFO - This is Biber 1.6Looking for bibtex format file 'Biblio.bib' for section 0Overriding locale 'en_US.UTF-8' default tailoring 'variable = shifted' with 'variable = non-ignorable'Sorting 'entry' list 'nty' keysNo sort tailoring available for locale 'en_US.UTF-8' – Zouib Feb 04 '14 at 17:58
  • I have Adobe Garamond Pro on my computer and I do obtain the glyphs correctly. So the problem isn't in the font. Did you check your versions of foncspec and luaotfload are the last ones? – Bernard Feb 04 '14 at 18:17
  • 2
    @Zouib: you should use this notation: {\"i} or {\"{\i}} but _not_{"\i}`. –  Feb 04 '14 at 18:33
4

Short answer

Biber does not understand {\"\i}. Fix the encoding with recode:

recode -d latex..UTF-8 biblio.bib 

Too long answer

The problem seems to be the string {\"\i} (which is meant to represent ï) in your bibliography. Biber gets confused and interprets it as {\"ı}, which is nonsense, and in turn, responsible for the bad output.

So the question is, what to do with the offending character? There are two general answers:

  1. Change the way your bibliography gets processed
  2. Remove the offending string from your bibliography

1. Change how the bibliography is processed

1.1 Call biber with --output_safechars.

To force biber to pass {\"\i} along unchanged, and thus getting the correct output, simply use the option --output_safechars:

xelatex document
biber --output_safechars document
xelatex document
xelatex document

1.2. Use bibtex8 as backend.

BibTeX does not modify {\"\i} in the process and it can be used with 'BibLaTeX'. (It is possible but not recommended using BibTeX instead of biber, because a lot of the advanced features will work only with the latter.) To do so set the option backend=bibtex8. Your MWE would look like this:

% !TEX encoding = UTF-8 Unicode
\documentclass[12pt]{scrbook}

\usepackage[english,frenchb]{babel}             
\usepackage[quiet]{fontspec}    

\usepackage[automark]{scrpage2}
\usepackage[babel,french=guillemets*]{csquotes} 
\usepackage[backend=bibtex8,style=authortitle-ticomp,doi=false]{biblatex} % <-- changed backend

\frenchbsetup{FrenchFootnotes=false}
\MakeOuterQuote{"}

\setmainfont[Mapping=tex-text, Ligatures={Common, Rare}, Numbers={OldStyle}]{Adobe Garamond Pro}

\addtokomafont{disposition}{\normalfont}
\addtokomafont{pageheadfoot}{\normalfont}       
\addtokomafont{pagenumber}{\normalfont} 
\addtokomafont{footnote}{\normalfont}               
\addtokomafont{footnotereference}{\normalfont}

\addbibresource{biblio.bib}             
\AtBeginBibliography{\def\UrlFont{\scriptsize}}

\begin{document}
"Héloïse"\footcite{GoncalvesdaCosta:2000tw}.
\printbibliography
\end{document}

To compile the document call:

xelatex document
bibtex document
xelatex document
xelatex document 

Both ways produce PDFs with correctly rendered ï:

enter image description here

2. Prevent {\"\i} from ending up in bibliography

2.1. Change the exported bibliography

The general approach would be replacing all occurrences of \"\i in your bibliography with \"i. This could be done with any text editor capable of searching and replacing strings. Of course there are tools to do that for you. sed is one of them:

sed s/\\"\\i/\\"i/g  < in.bib > out.bib 

Don't worry, there are others beside sed. The best tool on the command line is of course recode, all you have to do is:

recode -d latex..UTF-8 biblio.bib 

(Unfortunately recode does not come preinstalled with Mac OS X, but it can be easily installed with Homebrew.)

As you are on a Mac, you could use BibDesk:

  1. Open your bibliography with BibDesk:

enter image description here

  1. Export (Menu --> File --> Export...) as BibTeX and Unicode (UTF-8):

enter image description here

This will provide you with a valid UTF-8 BibLaTeX compatible file:

%% This BibTeX bibliography file was created using BibDesk.
%% http://bibdesk.sourceforge.net/


%% Created for you at 2014-02-11 23:42:00 +0000 


%% Saved with string encoding Unicode (UTF-8) 



@book{GoncalvesdaCosta:2000tw,
    Address = {Montréal},
    Author = {Goncalves Da Costa, Héloïsa},
    Publisher = {Université du Québec à Montréal},
    Title = {{Les musées d'histoire de ville leur contribution au développement social contemporain.}},
    Year = {2000}}

2.2. Use software capable of exporting BibLaTeX

Maybe you should ditch Papers and switch to JabRef, BibDesk, Mendeley, Zotero, vim or emacs.

DG'
  • 21,727
  • Hi @DG' thanks for your analyse, it produces effectively {\"ı} I try with bibtex8, but no change in my pdf. I don't know how calling your biber option… In command line ? Maybe, I can change the encoding when I create my .bib from Papers, but it purpose only : bibtex, xml endnote, reman RIS… So I chose obviously bibtex – Zouib Feb 05 '14 at 11:59
  • I find it in http://is.gd/mhZTCL (http://qandasys.info Audrey) : "A quick way to do this is to re-encode your bib file to Ascii with: biber --tool --output_encoding=ascii --output_safechars <file name>.bib" I try, but the problem persists… – Zouib Feb 05 '14 at 12:39
  • 1
    @Zouib have you tried compiling the document manually (maybe TeXShop calls biber instead of bibtex8)? If not, open a terminal, cd to your working directory and run latexmk -xelatex yourfile – DG' Feb 05 '14 at 12:40
  • 1
    Have you deleted all the temporary files (.aux, .bbl, etc.)? – DG' Feb 05 '14 at 12:43
  • Hi @DG' sorry for my absence a week… I always purchase the solution because it's ok in the exemple with just one reference, but in my real latex life, my bib is longer. In the biber ways, the problem persists. With the biber --output_safechars or the bibtex8 ways, this problem of ï & î disappear, but I return on my precedent complication: link I think Papers2 make a bad .bib encoding ;( – Zouib Feb 11 '14 at 16:58
  • 1
    Sorry to hear that. There is another way: open your file with bibdesk and save as UTF-8.

    PS: Papers is indeed known for all kinds of problems...

    – DG' Feb 11 '14 at 18:45
  • Your approach with using Bibdesk does obviously not work for everyone. But converting a text file (what .bib files essentially are) into UTF-8 without BOM (important!) is possible with every good text editor. (Yes, I noticed, that the OP does use MacOSX, but a general tipp is always good.) – Speravir Feb 11 '14 at 19:49
  • @Speravir using BibDesk should work for everybody with this particular problem. Remember: The problem is not the encoding of the file but the file that Papers 2 for Mac generates, and BibDesk correctly writes ï instead of {\"\i}. – DG' Feb 11 '14 at 19:57
  • @DG': BibDesk is for MacOSX only, that was my point. The OP does use this, but a hint for users of other OSes is always good (you first item should work for all). I didn’t even know Papers by name until now. – Speravir Feb 11 '14 at 20:38
  • Changed my answer in order to make it a little more general. – DG' Feb 11 '14 at 22:15
  • Excellent @DG', I installed brew & I recoded according your advice & miracle of technologie : all appears good. Tank you so much for your great help. – Zouib Feb 12 '14 at 10:41