Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

As best as I can understand, there are two ways to load the ctex package: as a document class (i.e. \documentclass{ctexbook} or as a package (i.e. \usepackage{ctex}). As I am using another document class, I have selected the later. This means, however, that the document uses English for titles throughout the document (e.g. table of contents, glossary).

When I try to rename the titles of parts of the documents, using \CTEXoptions, this always fails. E.g.:

\documentclass{book}
\usepackage{ctex}
\usepackage{xeCJK}
\usepackage{fontspec}
\CTEXoptions[contentsname={目录名}]
\begin{document}
    \tableofcontents
    \chapter{This is a chapter title}
\end{document}

This fails to compile:

! Package xkeyval Error: `contentsname' undefined in families `CTEX'.

See the xkeyval package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.6 \CTEXoptions[contentsname={目录名}]
  • How can I properly set the names of these items in my document?

contentsname 目录名

listfigurename 表格目录

listtablename 插图目录

figurename 图

tablename 表

abstractname 摘要

indexname 索引

bibname 参考文献

share|improve this question
add comment

2 Answers

up vote 5 down vote accepted

Load the ctexcap package instead of ctex. This will automatically redefine the strings you mentioned in your question. The command \CTEXoptions[contentsname={目录名}] will also then work.

P/S: Surely 目录名 is wrong?

share|improve this answer
add comment

This is a long comment of LianTze Lim's answer.

  • Load ctexcap package for other document classes. But you should only load ctexcap for those document classes based on standard article, report and book. For example, you can use ctexcap together with extarticle and ltxdoc, but you should NOT use ctexcap with beamer, scrartcl or moderncv. Actally ctexcap is rarely used.
    (EDIT: Well, it doesn't matter)

  • You don't need to use xeCJK and fontspec explictly when you use ctex bundle.

  • 目录名 should be 目录.

  • You are welcome to ask this kind of questions in CTeX forum.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.