1

I started to use biblatex not so long ago. Everything is working properly in general, however, I have had some trouble with the special character \'i, used in order to obtain the character "í".

It will render only under very specific conditions. For example, I have had no trouble when render it using the book entry type, but with the misc entry type there is almost every time a problem and here is where the specific conditions begin. Let's see the MWE first.

main.tex

\documentclass{IEEEtran}
\usepackage[style=ieee,backend=biber]{biblatex}
\addbibresource{references.bib}
\begin{document}
\nocite{Citation}
\printbibliography
\end{document}

references.bib

@misc{Citation,
    title={{\'a}{\'i}}
}

As you can see this MWE causes an error, a curious thing discovered is that if you make a brief modification in the references.bib file, the error is gone: instead of {\'a}{\'i} put {\'i}{\'a}.

A brief look at the output.bbl file can tell what is happening in the background: the input \'i is being interpreted as \'\i{}. This happens both in the misc and book entry types, the difference is that, for some reason, if the reference.bib (without the previous modification) is modified changing the entry type from misc to book, it will render without problem.

Question

How can this be fixed? What should be the correct workaround?

Additional info

I am working in an online platform (namely Overleaf).

Hans
  • 1,013
  • Seems as though \MakeSentenceCase has some problems with the characters ... (biblatex-ieee uses \MakeSentenceCase for @miscs, but not for @books). But maybe Biber's output routine needs tweaking. – moewe Apr 16 '16 at 08:06
  • Do you know which version of biber Overleaf is using? – PLK Apr 16 '16 at 08:24
  • @moewe Your comment reminds me another test I performed. The referencing style I have is IEEE, as you can see. The first character in the title is set to uppercase, and the rest of them are set to lowercase. Probably you noticed that when the \'i is at the beginning no uppercase alteration is performed. One more thing is that if you delete the \'a (leaving the \'i alone), the problem disappears but no character is rendered. – Hans Apr 16 '16 at 08:40
  • @PLK To be honest I have no idea, I guess I could ask them, however I also tried it with ShareLaTeX, obtaining the same result (same error). – Hans Apr 16 '16 at 08:41
  • @Hans: You could look in the blg and the log-file there the versions are recorded. Beside this imho the best solution is to avoid commands in the bib-file and to enter í directly (along with a suitable inputenc). – Ulrike Fischer Apr 16 '16 at 08:58
  • @PLK The current version of biber on Overleaf is 2.1. – imnothere Apr 16 '16 at 09:11
  • @Hans: since biber understands utf8, why don't you simply type í or à durectly from your keyboard? In short: encode your .bib file in UTF8. – Bernard Apr 16 '16 at 09:59
  • 1
    @PLK I can reproduce the behaviour with current Biber 2.4. I guess that \MakeSentenceCase has some trouble with the characters from the .bbl (\'{a}\'\i{}). – moewe Apr 16 '16 at 11:06
  • @moewe - hmm - if you think we have a bug here, can you file it? – PLK Apr 16 '16 at 11:08
  • @PLK Not sure if it is a bug. I will file a report and you can see what to do with it ... – moewe Apr 16 '16 at 11:11

1 Answers1

4

(You mentioned that you're working on Overleaf, so here's what you can do to get your Overleaf project to compile correctly.)

Method 1: Use XeLaTeX or LuaLaTeX

...which are able to handle UTF8 characters out of the box.

On Overleaf, you can set the engine to use by clicking on the Settings icon (the gear icon on the upper right of the editor, just next to your user name), and then selecting XeLaTeX or LuaLaTeX from the "LaTeX engine" drop list. Don't forget to click on "Save Project Settings".

Method 2: Tweak biber

If you need to use pdfLaTeX, you can tweak biber to use the --output-safechars option, as outlined in Input encoding error after upgrading from Biber 1.9 to Biber 2.1.

On Overleaf, you can do this by adding a latexmkrc file to your project, and then put the following line in it:

$biber = "biber --output-safechars %O %S";
imnothere
  • 14,215