Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Package inputenc Error: Unicode char \u8:β not set up for use with LaTeX

Tags:

unicode

utf-8

tex

One of my references in Bibdesk contains some latin/Greek character e.g. 'β'. I am getting the error while using the reference in TEXMAKER: "! Package inputenc Error: Unicode char \u8:β not set up for use with LaTeX."

How can I set it up to work?

like image 816
sourav mandal Avatar asked Sep 22 '14 07:09

sourav mandal


1 Answers

Though with inputenc TeX can read all the unicode characters, it doesn't know what to do with most of them, except those in the usual ascii range. I once also had a problem with that, when I wanted to copy some unicode text verbatim into one of my TeX documents, and that text contained symbols like alpha, or other math symbols.

The solution to that is the command \DeclareUnicodeCharacter{#1}{#2} where in #1 you have to put the unicode value of the character and in #2 a tex expression, that gets inserted, when character code #1 is encountered. E.g. for the beta you could use \DeclareUnicodeCharacter{03B2}{\ensuremath{\beta}}, because 03B2 is the unicode character value for the symbol "beta" (you have to look those things up in a Unicode table).

I've also written a tex package for that, if you're interested. It can be found on github at https://github.com/ezander/utf8math. See especially this file here: https://github.com/ezander/utf8math/blob/master/utf8math.sty

like image 71
Elmar Zander Avatar answered Oct 01 '22 12:10

Elmar Zander