[Tex/LaTex] Using UTF and not displaying accent marks

accentsinput-encodingskileunicode

I'm having this issue wich started some time ago and now is being quite annoying.

I write in spanish and need to use accent marks a lot. I usually start my articles or reports with the preamble pasted below, and I used to have no problems. But some months ago when trying to type a letter with accent mark instead of writing for example "á" it turned out "'a", and the outcome in the PDF would be "a" with no accent mark at all (I could still write "\'a" and that would work but it is not the idea when using UTF8 and inputenc). I use Kile and Ubuntu, and after some minutes with the app running it would start working OK out of the blue.

Now i've moved to Elementary OS and reinstalled Kile and it is not working at all, not even after some minutes. I've tryied with Texmaker and same issue. With Libreoffice instead everything works OK.

I've searched a lot and tryied every possible workaround I found online but nothing seems to work… Anyone has an idea?

\documentclass[12pt]{article}
\usepackage[spanish]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\begin{document}
´a  ´e   ´i
\end{document}

And I found this in the log

! Package inputenc Error: Unicode char ´ (U+B4)
(inputenc)                not set up for use with LaTeX.

See the inputenc package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.8 ´
      a  ´e   ´i
Your command was ignored.
Type  I <command> <return>  to replace it with another command,
or  <return>  to continue without it.

Thanks a lot. Alejandro

Best Answer

\documentclass[12pt]{article}
\usepackage[spanish]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\begin{document}
´a  ´e   ´i
\end{document}

uses the rather unused Unicode character U+00B4 (ACUTE ACCENT)

The intention is that you use

\documentclass[12pt]{article}
\usepackage[spanish]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\begin{document}
á  é   í
\end{document}

If you really need the original to work, declare the character as an accent command

\documentclass[12pt]{article}
\usepackage[spanish]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\DeclareUnicodeCharacter{00B4}{\'}
\begin{document}
´a  ´e   ´i
\end{document}
Related Question