7

i get an error when i try to compile my document and it drives me crazy. I have a lot of citations from a bib file, and i always get the Error listed above which (how i understand it) means i have thin spaces in my bib file, but i cant figure out where they are supposed to be and the file is too large to check every space. I already corrected any present ä, ö, ü etc., so it has to be a problem with the spaces. I copied the bib-references with a citation tool directly from the articles, maybe that's the problem? But it seems idiotic to me to write the citations myself.

Here's the Error again: Error: ! Package inputenc Error: Unicode char   (U+2009)(inputenc) not set up for use with LaTeX.See the inputenc package documentation for explanation.Type H for immediate help.... ...bliography[heading=bibempty,type=article]

I have run it many times through biber (which gives me no errors), deleted aux, bbl and bcf files, checked the bib file many times for odd spacings to figure out where those thin spaces are, but i could not find the error.

What is the best solution for this problem?

I dont know how to make a proper MWE with the huge bib file of over 1000 lines, sry. Here are the packages i use:

\documentclass[12pt,fleqn,xcolor=dvipsnames]{book}
\usepackage[top=3cm,bottom=3cm,left=3cm,right=3cm,headsep=10pt,a4paper]{geometry} % Page margins
\usepackage[table]{xcolor}
\usepackage{graphicx}
\graphicspath{{Pictures/}}
\usepackage{tikz}
\usepackage[english,german]{babel}
\usepackage{enumitem}
\usepackage{avant}
\usepackage{mathptmx}
\usepackage{microtype}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[style=numeric,citestyle=numeric,sorting=nyt,sortcites=true,autopunct=true,babel=hyphen,hyperref=true,abbreviate=false,backref=true,backend=biber]{biblatex}
\usepackage{titletoc}
\usepackage{fancyhdr} 
\usepackage{amsmath,amsfonts,amssymb,amsthm}

\begin{document}

\end{document}

I also have notations (with %) in my bib File to know which lines of the articles i cited. Could this cause the problems? For Example:

%[ab] In patients with NYHA class II or III CHF and LVEF of 35 percent or less, amiodarone has no favorable effect on survival, whereas single-lead, shock-only ICD therapy reduces overall mortality by 23 percent.
@article{doi:10.1056/NEJMoa043399,
author = {Bardy, Gust H. and Lee, Kerry L. and Mark, Daniel B.  and Poole, Jeanne E. and Packer, Douglas L. and Boineau, Robin  and Domanski, Michael and Troutman, Charles and Anderson, Jill  and Johnson, George and McNulty, Steven E. and Clapp-Channing, Nancy and Davidson-Ray, Linda D. and Fraulo, Elizabeth S. and Fishbein, Daniel P. and Luceri, Richard M. and Ip,  John H.},
title = {Amiodarone or an Implantable Cardioverter-Defibrillator for Congestive Heart Failure},
journal = {New England Journal of Medicine},
volume = {352},
number = {3},
pages = {225-237},
year = {2005},
doi = {10.1056/NEJMoa043399},
note ={PMID: 15659722},
URL = {https://doi.org/10.1056/NEJMoa043399},
eprint = {https://doi.org/10.1056/NEJMoa043399}
}
5
  • 5
    You could copy-and-paste parts of your file to w3c.github.io/xml-entities/unicode-names.html to check the spaces. Some editors (like Notepad++) also let you search for specific characters (by their Unicode code point). You could also do \DeclareUnicodeCharacter{2009}{XXXX here is the little bugger XXXX} and then search your compiled document for XXXX to locate the problematic space. (As far as I can see, the problem does not come from the example reference.)
    – moewe
    Jun 27, 2018 at 12:06
  • Also: Welcome to TeX.SX
    – moewe
    Jun 27, 2018 at 12:07
  • I cannot find any problematic code in the posted material. Please make an MWE that actually give this error on your end.
    – daleif
    Jun 27, 2018 at 12:20
  • 6
    There are no U+2009 characters in the fragment you posted. You can use \DeclareUnicodeCharacter{2009}{\,} to declare the thin space as a thin space if you want the error to go, or \DeclareUnicodeCharacter{2009}{FIXME} if you just want to see where they are and delete them. Note the full error message (which you do not show) does show the exact location in the file where the character is. Jun 27, 2018 at 12:22
  • 1

2 Answers 2

7

Thank you for the quick answers!

I downloaded Notepad++ and tried to figure out how to find the Unicode Char, but apparently i was too unfamiliar with the program to figure it out (and maybe a bit too impatient). But thanks for the option, i might reconsider it later, when i make final improvements to my article.

At the moment i don't think i intend to change the thin space to a full space because it is only in my Bibliography (and therefore noone will care how wide the space is) and since i keep on adding Citations this might be a never ending story. I dont know how many automated Citations have such characters and i dont want to waste time correcting them for a miniscule optical improvement.

\DeclareUnicodeCharacter{2009}{\,} 

worked fine, thank you very much! My file now compiles without problemes and i wont have any further problemes.

1
  • 2
    You can search for the thin space if you search for \x{2009} in Notepad++ with RegExp enabled (the bottommost search mode on the bottom left of the search window). Ideally you would find the offending thin space - it is very unlikely but not impossible that a thin space in the wrong place could lead to undesired output.
    – moewe
    Jun 28, 2018 at 15:40
1

Appreciate this is an old post but it's highly ranked on Google, so thought I'd add that as of VS Code 1.63 there is automatic highlighting of invisible unicode characters, such as U+2009.

https://code.visualstudio.com/updates/v1_63

Thanks to Mark on SO for pointing this out: https://stackoverflow.com/a/70164173/12155200

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .