0

I'm getting errors such as this: Package inputenc Error: Unicode char \u8:ärt not set up for use w and this Package inputenc Error: Unicode char \u8:é\isdot\ifblank not set when trying to compile a bibliography in the below code. There is clearly some sort of an issue with the accented characters. Does anyone know how to resolve?

\documentclass[12pt, a4paper, oneside]{Thesis}\usepackage[]{graphicx}\usepackage[]{color}
%% maxwidth is the original width if it is less than linewidth
%% otherwise use linewidth (to make sure the graphics do not exceed the margin)
\makeatletter
\def\maxwidth{ %
  \ifdim\Gin@nat@width>\linewidth
    \linewidth
  \else
    \Gin@nat@width
  \fi
}
\makeatother

\definecolor{fgcolor}{rgb}{0.345, 0.345, 0.345}
\newcommand{\hlnum}[1]{\textcolor[rgb]{0.686,0.059,0.569}{#1}}%
\newcommand{\hlstr}[1]{\textcolor[rgb]{0.192,0.494,0.8}{#1}}%
\newcommand{\hlcom}[1]{\textcolor[rgb]{0.678,0.584,0.686}{\textit{#1}}}%
\newcommand{\hlopt}[1]{\textcolor[rgb]{0,0,0}{#1}}%
\newcommand{\hlstd}[1]{\textcolor[rgb]{0.345,0.345,0.345}{#1}}%
\newcommand{\hlkwa}[1]{\textcolor[rgb]{0.161,0.373,0.58}{\textbf{#1}}}%
\newcommand{\hlkwb}[1]{\textcolor[rgb]{0.69,0.353,0.396}{#1}}%
\newcommand{\hlkwc}[1]{\textcolor[rgb]{0.333,0.667,0.333}{#1}}%
\newcommand{\hlkwd}[1]{\textcolor[rgb]{0.737,0.353,0.396}{\textbf{#1}}}%

\usepackage{framed}
\makeatletter
\newenvironment{kframe}{%
 \def\at@end@of@kframe{}%
 \ifinner\ifhmode%
  \def\at@end@of@kframe{\end{minipage}}%
  \begin{minipage}{\columnwidth}%
 \fi\fi%
 \def\FrameCommand##1{\hskip\@totalleftmargin \hskip-\fboxsep
 \colorbox{shadecolor}{##1}\hskip-\fboxsep
     % There is no \\@totalrightmargin, so:
     \hskip-\linewidth \hskip-\@totalleftmargin \hskip\columnwidth}%
 \MakeFramed {\advance\hsize-\width
   \@totalleftmargin\z@ \linewidth\hsize
   \@setminipage}}%
 {\par\unskip\endMakeFramed%
 \at@end@of@kframe}
\makeatother

\definecolor{shadecolor}{rgb}{.97, .97, .97}
\definecolor{messagecolor}{rgb}{0, 0, 0}
\definecolor{warningcolor}{rgb}{1, 0, 1}
\definecolor{errorcolor}{rgb}{1, 0, 0}
\newenvironment{knitrout}{}{} % an empty environment to be redefined in TeX

\usepackage{alltt} % Paper size, default font size and one-sided paperR
\usepackage{alltt} % Paper size, default font size and one-sided paperR

\usepackage{nameref}

\usepackage{array}
\usepackage{booktabs}
\usepackage{tabularx}

\usepackage{etex}

\usepackage{lmodern}

\usepackage{caption}
\captionsetup[table]{position=below}

\usepackage{placeins} % to control figure placement with \FloatBarrier

\usepackage{fontspec}
\setmainfont{Lucida Sans}

% biblatex----------------------------------------------------------------------------------------
\usepackage[style=authoryear-comp, maxcitenames=2, maxbibnames=99, uniquelist=false,firstinits=true,sorting=nyt]{biblatex}
\DeclareNameAlias{sortname}{last-first}
\DeclareNameAlias{default}{last-first}

\usepackage{xpatch}

% No dot before number of articles
\xpatchbibmacro{volume+number+eid}{%
  \setunit*{\adddot}%
}{%
}{}{}

% Number of articles in parentheses
\DeclareFieldFormat[article]{number}{\mkbibparens{#1}}

\renewbibmacro{in:}{}

\addbibresource{\jobname.bib}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{PartDoligez2003,
  title={Gathering public information for habitat selection: prospecting birds cue on parental activity},
  author={P{\"a}rt, Tomas and Doligez, Blandine},
  journal={Proceedings of the Royal Society of London. Series B: Biological Sciences},
  volume={270},
  number={1526},
  pages={1809--1813},
  year={2003},
  publisher={The Royal Society}
}
@article{HacheEtAl2013,
  title={Experimental evidence for an ideal free distribution in a breeding population of a territorial songbird},
  author={Hach{\'e}, Samuel and Villard, Marc-Andr{\'e} and Bayne, Erin M},
  journal={Ecology},
  volume={94},
  number={4},
  pages={861--869},
  year={2013},
  publisher={Eco Soc America}
}
@article{Hilden1965,
  title={Habitat selection in birds: a review},
  author={Hild{\'e}n, O},
  journal={Ann. Zool. Fenn},
  volume={2},
  pages={53--74},
  year={1965}
}


\end{filecontents}

\begin{document}

    \cite{PartDoligez2003}\\\\
    \cite{HacheEtAl2013}\\\\
    \cite{Hilden1965}

\printbibliography

\end{document}
  • I don't get any errors with your sample code if I swich the document class from Thesis to article. Do the same happens to you? If so, the problem lies in Thesis.cls and we will need to see the file to detect the problem. – Gonzalo Medina Jun 21 '15 at 17:12
  • You could have at least tried to make that more minimal. – Johannes_B Jun 21 '15 at 17:12
  • The example requires XeLaTeX or LuaLaTeX as package fontspec is loaded. inputenc shouldn't even be loaded. Does that happen in the class file? – Johannes_B Jun 21 '15 at 17:16
  • 4
    I guess this is a template from a well known template site. 14 of the various Thesis.cls on my HDD (that's how much trouble arises from templates) include inputenc. Since you are required to change the cls either way, simply delete that line from the file. And please please please report that issue to the guy/site you obtained Thesis.cls from. – Johannes_B Jun 21 '15 at 17:19
1

I have no problem compiling, if I declare Lucida Sans Unicode as main font. I suspect Lucida Sans is a type 1 font, requiring font encoding declaration, &c., which might be the source of the problem.

Incidentally, to have nice quotes in your bibliography, load csquotes. Without it, I had hideous fake opening quotes. Also, you may type accented letters in the .bib file: biber understands UTF8.

enter image description here

  • A combination of deleting the line containing inputenc and adding \usepackage{csquotes} has apparently solved problems – luciano Jun 23 '15 at 14:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.