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

2

10

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?

Heather answered 22/9, 2014 at 7:48 Comment(1)
See en.wikibooks.org/wiki/LaTeX/Special_CharactersWrongly
M
5

Another solution is to use XeTeX, which is more suitable than most other TeX engines for unicode : replace the lines

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

with

\usepackage{fontspec}
Matriculation answered 4/7, 2017 at 10:52 Comment(0)
M
15

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

Mcnulty answered 16/1, 2015 at 8:47 Comment(1)
Thank you for that help, Elmar! It also helped me find the unicode-math package on CTAN which has similar functionality (ctan.org/pkg/unicode-math?lang=en).Gobi
M
5

Another solution is to use XeTeX, which is more suitable than most other TeX engines for unicode : replace the lines

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

with

\usepackage{fontspec}
Matriculation answered 4/7, 2017 at 10:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.