1

I have this problem, it seems i'm doing something wrong while writing letters with accents like "è", on that line the compiler says: package inputenc Error: unicode char \u8:èun not set up for use. This happens when i use my latex editor, compiling the same code with an R sweave file on Rstudio it works normally and i got my accents on letters.

the code is this one

\documentclass[12pt,a4paper,oneside,openright]{book} %oneside versione segreteria
\usepackage[a4paper,top=2cm,bottom=2cm,left=3cm,right=2.5cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english,italian]{babel}
\usepackage{bm}
\usepackage{amsmath}
\usepackage{mathrsfs}
%\uspackage{graphicx}
\usepackage{hyperref}

\begin{document}

%________________________________________________________________

\frontmatter

%space for abstract

\pagestyle{plain}
\tableofcontents

%_______________________________________________


\mainmatter

\pagestyle{plain} 

%Primo Capitolo
%\addcontentsline{toc}{chapter}{Introduzione}

\chapter*{Introduzione}

L'accrescimento è  


\end{document}
  • 4
    Are you sure the file is UTF-8 encoded? – egreg Jun 1 '16 at 14:36
  • what do you mean? sorry i'm not an expert on LaTeX. It's that i always put that kind of preamble and it always worked. – Run like hell Jun 1 '16 at 14:50
  • What editor are you using? – egreg Jun 1 '16 at 14:53
  • TeXShop, always used it – Run like hell Jun 1 '16 at 14:57
  • 2
    If you haven't changed its preferences, TeXShop doesn't save in UTF-8. Remember to add % !TEX encoding = UTF-8 Unicode at the start of your files. Do it and save the file; close and reopen it, then try running LaTeX on it. – egreg Jun 1 '16 at 14:59
4

Very likely your file ended up not being saved as UTF-8.

If you didn't change the default settings in the preferences, TeXShop saves files as Latin-1 (older versions use MacRoman).

Remember to add

% !TEX encoding = UTF-8 Unicode

at the start of your files. Do it and save the file; close and reopen it, then try running LaTeX on it.

In any case, it's better if you also go to the preferences and change the default encoding to UTF-8.

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.