5

I'm using Zotero to manage and export reference lists. Sometimes text fields contain an accent, circumflex, umlaut etc.

When I used such bib files in LyX (tried the plain and unsrturl styles), I get the following errors:

  • Command \texteuro unavailable in encoding T1 (similar error for OT1; using \usepackage{textcomp} makes the error disappear)
  • Undefined control sequence
  • Package inputenc Error: Keyboard character used is undefined (still appears, even after using \usepackage{textcomp})

Only when I replace accented characters with regular characters the code compiles.

Sparkler
  • 929

2 Answers2

3

As @MikeRenfro pointed out, the solution from OhadSoft: Zotero – exporting Unicode and LaTeX constructs to BibTex, worked:

  1. Zotero Preferences -> Export -> check Display character encoding option on export.
  2. Whenever you export your database, pick a non-Unicode character encoding such as ISO-8859-1
Sparkler
  • 929
  • I think that in newest versions of Zotero this solution is not working. Im using 5.0.64 and even that by default you can pick an encoding option when exporting, you cant select ISO-8859-1 nor latin1 anymore. Im stuck with this same problem. – Santiago Capobianco Mar 22 '19 at 14:37
1

I am not using Lyx, but I have just gone through this issue with my own Zotero setup. The issue is that Zotero encodes everything with UTF-8 (Unicode), so the exported .bib files it creates will also have UTF-8 encoding. BibLaTex is UTF-8-compatible, but BibTex is not; so, if you are trying to compile with BibTex or Biber, i.e., you have a line such as \usepackage[backend=biber, citestyle=chem-acs, maxbibnames=99]{biblatex} in your preamble, it will give you an error complaining about UTF-8. In my case, I'm using TexWorks, so I only get the error when I recompile with pdfLaTex. This is a major issue and there are many open questions about it.

I tried adding \usepackage[utf8]{inputenc} to my preamble, but it didn't help.

A currently-working solution is to use the excellent 3rd party Zotero Add-on zotero-better-bibtex to export a BibTex-formatted .bib file with the UTF-8-encoded characters swapped to LaTeX-encoded characters. There is currently no way to do this by default in Zotero.

In order to install the add-on, I had to upgrade to the latest version of Zotero and then install zotero-better-bibtex according to the instructions:

In order to export the .bib with unicode swapped to LaTeX

  • select export > Format: Better BibTex (not Better BibLaTex (BibLaTex is UTF-8-compatible))
  • In TexWorks,
    1. Compile with pdfLaTeX
    2. Compile with Biber
    3. Compile with pdfLaTeX

I can now compile without errors and get a PDF of the bibliography with properly formatted special characters

gannex
  • 121
  • 2