# Using UTF and not displaying accent marks

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
Type  I <command> <return>  to replace it with another command,
or  <return>  to continue without it.


Thanks a lot. Alejandro

• thanks for the answer David, it says main.tex: LaTeX 2e document, ASCII text. In Kile -> Settings -> Configure -> Open/Save -> General -> Encoding it is set to UTF-8, and when I saved it, in Save as: i set also the encoding to UTF8 – aguaacrobata Jan 11 '17 at 15:05
• thanks david, i searched in the log file and found what i edited in my post, as well as a mini working example – aguaacrobata Jan 11 '17 at 15:51
• You have to input á é í, not using that strange character. – egreg Jan 11 '17 at 15:52
• U+00B4 is spacing acute not even the combining character. How did you type that (and what does ´e look like in your editor window, not like é presumably? – David Carlisle Jan 11 '17 at 16:11

\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}

• yes, well indeed in my keyboard (standard spanish) I first have to type " ´ " and then " a " to get an " á ", the command "á" does not exist on keyboards in spanish... it works everywhere (libreoffice, chromium, this very box, when I configure imput method in Ubuntu/Elementary OS), and used to work in Latex, but it does not anymore, after I write " ´ + a " in my editor window (and looks like that in Kile) I just get a straigth " a " in the PDF output... This idea of yours it is an excelent alternative, and it is working OK, but I still hope this issue stops happening in next actualiazations. – aguaacrobata Jan 12 '17 at 13:03
• @aguaacrobata so that is an editor setup issue nothing to do with latex (I can not help with Kile) In the other apps when you type that key combination the single accented character is actually passed to the application or saved in the file, if your editor you are using for tex did the same then inputenc would work, but it is not recognising that input method and saving the two characters separately into the file and that won't work by default anywhere. (try cutting and pasting the text into libreoffice I would assume it stays as 'a two characters, as the mapping is just for input keystrokes) – David Carlisle Jan 12 '17 at 17:12

If the accents are working correctly in your terminal, try opening Kile from the terminal instead of shortcuts or Alt + F2.