用TexStudio編輯文檔時,不知是多加了空格還是啥,總是提示如下錯誤:
Package inputenc Error: Unicode char \u8: not set up for use with LaTeX.
刪除掉一些內容(code)之后可以成功編譯,不過添加(code)之后,又反復出現了。如此幾次,真是抓狂。
遂到tex.stackchange.com上找尋到:戳這里。說是有Non-Breaking Space。
依照其添加了:
\DeclareUnicodeCharacter{00A0}{~}
不過問題依舊啊。
閱讀文檔:
This is due to the utf8 definition not necessarily having a mapping of all the character glyphs you are able to enter on your keyboard.
后面還提到:
With XeTeX and LuaTeX the inputenc package is no longer needed. Both engines support UTF-8 directly and allow the use of TTF and OpenType fonts to support Unicode characters. See the Fonts7 section for more information.
將編譯環境換成XeLatex,不過漢字完全不見了!!
繼續搜索'XeLatex 中文',原來是缺少宏包,引入宏包(注釋掉原來的CJK宏包引用,貌似會造成沖突):
\usepackage{xeCJK}
成功編譯。相信這次是從根源上解決了這個問題。
