After adding unicode characters to \title{}
micro:
\title{标题}
the following error occurs when running make all-pdf
with a .tex
file:
Writing index file mybook.idx
No file mybook.aux.
(/usr/share/texmf-dist/tex/latex/base/ts1cmr.fd)
(/usr/share/texmf-dist/tex/latex/psnfss/t1ptm.fd)
(/usr/share/texmf-dist/tex/context/base/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
) (/usr/share/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty
(/usr/share/texmf-dist/tex/latex/oberdiek/grfext.sty)
(/usr/share/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))
(/usr/share/texmf-dist/tex/latex/hyperref/nameref.sty
(/usr/share/texmf-dist/tex/generic/oberdiek/gettitlestring.sty))
(/usr/share/texmf-dist/tex/latex/cjk/texinput/UTF8/UTF8.bdg)
(/usr/share/texmf-dist/tex/latex/cjk/texinput/UTF8/UTF8.enc)
(/usr/share/texmf-dist/tex/latex/cjk/texinput/UTF8/UTF8.chr)
! Extra \else.
\CJK@XXX ...\number `#1\endcsname {`#2}{`#3}\else
\csname u8:\string #1\stri...
l.124 \tableofcontents
?
I have added the follow setting to the .tex
file:
\hypersetup{unicode=true}
\usepackage{CJKutf8}
\AtBeginDocument{\begin{CJK}{UTF8}{gbsn}}
\AtEndDocument{\end{CJK}}
If I remove the unicode characters, and replace them with acsii characters, it works well. If anything I forgot to add to the .tex
to achieve this?
the minimal .tex
file to reproduce the error:
% Generated by Sphinx.
\def\sphinxdocclass{report}
\documentclass[letterpaper,10pt,english]{sphinxmanual}
\usepackage[utf8]{inputenc}
\DeclareUnicodeCharacter{00A0}{\nobreakspace}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{times}
\usepackage[Bjarne]{fncychap}
\usepackage{longtable}
\usepackage{sphinx}
\usepackage{multirow}
\usepackage{CJKutf8}
\AtBeginDocument{\begin{CJK}{UTF8}{gbsn}}
\AtEndDocument{\end{CJK}}
\title{title 中文}
\date{June 21, 2013}
\release{1.0.0}
\author{author}
\newcommand{\sphinxlogo}{}
\renewcommand{\releasename}{Release}
\makeindex
\makeatletter
\begin{document}
\maketitle
\tableofcontents
\printindex
\end{document}
the specific error message:
(/usr/share/texmf-dist/tex/context/base/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
) (/usr/share/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty
(/usr/share/texmf-dist/tex/latex/oberdiek/grfext.sty)
(/usr/share/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))
(/usr/share/texmf-dist/tex/latex/hyperref/nameref.sty
(/usr/share/texmf-dist/tex/generic/oberdiek/gettitlestring.sty))
(./mybook.out) (./mybook.out)
(/usr/share/texmf-dist/tex/latex/cjk/texinput/UTF8/UTF8.bdg)
(/usr/share/texmf-dist/tex/latex/cjk/texinput/UTF8/UTF8.enc)
(/usr/share/texmf-dist/tex/latex/cjk/texinput/UTF8/UTF8.chr)
! Extra \else.
\CJK@XXX ...\number `#1\endcsname {`#2}{`#3}\else
\csname u8:\string #1\stri...
l.32 \tableofcontents
?
if I remove the unicode characters from \title{title 中文}
into \title{title}
, it works well.
\documentclass{...}
and ending with\end{document}
. Make sure to only include the code that is necessary to reproduce the problem and nothing else.