I move code from Miktex into Texlive. But I get errors:
Run in Xelatex
! Undefined control sequence.
\chaptername ->第\CJKnumber
{\thechapter }章
l.33 \chapter{绪论}
?
My minimal work is:
% !Mode:: "TeX:UTF-8"
\documentclass[12pt,a4paper,oneside,openany]{book}
\usepackage{fontspec,xunicode,xltxtra}
\usepackage[slantfont,boldfont,CJKnumber]{xeCJK}
\usepackage[bookmarksnumbered]{hyperref}
\usepackage{subfig}
\usepackage{titlesec}
\usepackage[titles,subfigure]{tocloft}
\usepackage[numbers,square,super,sort&compress]{natbib}
\defaultfontfeatures{Mapping=tex-text}
\setromanfont{Times New Roman}
\setCJKmainfont[BoldFont=SimHei,ItalicFont=KaiTi]{SimSun}
\setCJKmonofont[BoldFont=SimHei]{SimSun}
\setCJKsansfont{KaiTi}
\settowidth{\parindent}{空格}
\setCJKfamilyfont{youyuan}{幼圆}
\renewcommand{\contentsname}{目\hspace{1.5em}录}
\renewcommand{\chaptername}{第\CJKnumber{\thechapter}章}
\titleformat{\chapter}[block]{\bfseries\huge\filcenter}{\chaptertitlename}{1em}{}
\renewcommand{\bibname}{参考文献}
\renewcommand{\cftchappresnum}{第\CJKnumber}
\renewcommand{\cftchapaftersnum}{章}
\renewcommand{\cftchapnumwidth}{4em}
\renewcommand{\figurename}{图}
\renewcommand{\tablename}{表}
\begin{document}
\tableofcontents
\chapter{绪论}
\section{引言}
\end{document}
Best Answer
As far as I understand from the package code, the option
CJKnumber
has been deprecated and indeed you findin the log file. Solution:
Avoid loading
xunicode
andxltxtra
. Instructions that say to do so are outdated.