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

末鹿安然 提交于 2019-12-10 15:45:08

问题


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?


回答1:


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}



回答2:


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



来源:https://stackoverflow.com/questions/25969041/package-inputenc-error-unicode-char-u8%ce%b2-not-set-up-for-use-with-latex

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!