I successfully can compile with Chinese characters in my documents using CJKutf8
. However it makes all my files, that use fancyhdr
with pagestyle fanc
to throw encoding related errors during compilation.
Minimal example to reproduce (assuming that cjk support is installed on the system and running):
\documentclass{article}
\usepackage{CJKutf8}
\usepackage{fancyhdr}
%\pagestyle{fancy} % <---- uncomment to throw error in compile
\begin{document}
\begin{CJK*}{UTF8}{gbsn}
\section{前言}
\section{关于数学部分}
数学、中英文皆可以混排。You can intersperse math, Chinese and English (Latin script) without adding extra environments.
\end{CJK*}
\bigskip %% Just some white space
You can also insert Latin text in your document
\bigskip %% Just some white space
\begin{CJK*}{UTF8}{bsmi}
這是繁體中文。
\end{CJK*}
\end{document}
Example was taken from here and extended.
Uncommenting \pagestyle{fancy}
produces the following error:
! PACKAGE INPUTENC ERROR: UNICODE CHAR � (U+5173)
(INPUTENC) NOT SET UP FOR USE WITH LATEX.
SEE THE INPUTENC PACKAGE DOCUMENTATION FOR EXPLANATION.
Type H <return> for immediate help.
Now I don't want to use xetex or luatax as workarounds and I also have created some quite complex headers in my documents, which I'd like to keep.
So my question is, if there is a way to resolve this error for example by adding a specific package or configure fancyhdr
correctly.