我正在使用 编写一本中文书ctexbook
,但是当我使用 chapter 命令时,它不会用中文写出“chapter”这个词。这是我的代码:
\usepackage[a4paper, total={6in, 9in}]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{multirow}
\usepackage{longtable}
\usepackage{array}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{float}
\usepackage{txfonts}
\usepackage{pxfonts}
\usepackage{lmodern}
\usepackage[dvipsnames]{xcolor}
\setlength{\parindent}{0pt}
\usepackage{tkz-base}
\usepackage{tikz}
\usepackage{tkz-euclide}
\pagestyle{plain}
\setlength{\unitlength}{0.5cm}
\usepackage{accents}
\newcommand{\varvec}[1]{\underaccent{\tilde}{#1}}
\newcommand{\placenum}[1]{\makebox(1,1){#1}}
\newcommand*\circled[1]{\tikz[baseline=(char.base)]{
\node[shape=circle,draw,inner sep=1pt] (char) {#1};}}
\usetikzlibrary{arrows}
\makeatletter
\pgfkeys{
/tkzlabelX/no zero/.style={
/tikz/xlabel style/.append style={
style/.expand once={\ifdim\tkz@pos pt=0pt shape=coordinate\fi}}},
/tkzlabelY/no zero/.style={
/tikz/ylabel style/.append style={
style/.expand once={\ifdim\tkz@pos pt=0pt shape=coordinate\fi}}},
/tkzAxeXY/no zero/.code=, /tkzdrawX/no zero/.code=, /tkzdrawY/no zero/.code=,
/tkzlabelX/make an O/.style={
/tikz/xlabel style/.append style={
style/.expand once={\ifdim\tkz@pos pt=0pt
shape=rectangle, fill=none, fill/.code=, % no filling, please
pos=.5, yshift=+3pt, anchor=south east, % counter default xlabel style
inner sep=+.3333em, /utils/exec=\def\tkz@Xresult{$O$}\fi}}},
/tkzAxeXY/make an O/.code=, /tkzlabelY/make an O/.code=,
/tkzdrawX/make an O/.code=, /tkzdrawY/make an O/.code=}
\makeatother
\setlength{\parindent}{0pt}
\usepackage{hyperref}
\hypersetup{
colorlinks=true,
linkcolor=black,
filecolor=purple,
urlcolor=RoyalBlue,
pdfpagemode=FullScreen,
}
\newcommand{\nc}{\newcommand}
\nc{\opta}{\textbf{A) }}
\nc{\optb}{\textbf{B) }}
\nc{\optc}{\textbf{C) }}
\nc{\optd}{\textbf{D) }}
\nc{\boxa}{\boxed{\textbf{A)}}}
\nc{\boxb}{\boxed{\textbf{B)}}}
\nc{\boxc}{\boxed{\textbf{C)}}}
\nc{\boxd}{\boxed{\textbf{D)}}}
\nc{\longdots}{\dots\dots\dots\dots}
\nc{\q}{Question }
\nc{\que}{\textbf{Question: }}
\nc{\ans}{\textbf{Answer: }}
\nc{\nms}{\normalsize}
\nc{\underlinefive}{\underline{\ \ \ \ \ }}
\nc{\underlineten}{\underline{\ \ \ \ \ \ \ \ \ \ }}
\nc{\underlinetwenty}{\underlineten\underlineten}
\nc{\underlinethirty}{\underlinetwenty\underlineten}
\nc{\underlineforty}{\underlinethirty\underlineten}
\nc{\qqquad}{\qquad\quad}
\nc{\qqqquad}{\qquad\qquad}
\usepackage{xcolor}
\usepackage{sectsty}
\sectionfont{\fontsize{18}{15}\selectfont}
\subsectionfont{\fontsize{15}{15}\selectfont}
\subsubsectionfont{\fontsize{13}{15}\selectfont}
\usepackage{titlesec}
\begin{document}
\begin{titlepage}
\begin{center}
\vspace*{1cm}
\Huge
\textbf{中国高中数学}\\
\vspace{2cm}
\LARGE
\textbf{2023 高一上}\\
\vspace{1cm}
第1 -- 13课
\end{center}
\end{titlepage}
\newpage
\phantom{a} \pagenumbering{gobble}
\newpage
\pagenumbering{roman}
\LARGE
\tableofcontents
\newpage
\phantom{a} \pagenumbering{gobble}
\newpage
\normalsize \pagenumbering{arabic}
\chapter{集合中的常用思想}
\section{元素与集合}
\vspace{1cm}
\subsection{知识点睛}
\vspace{1em}
\end{document}
有人能帮帮我吗?
谢谢你!
答案1
您应该简化您的代码并减少不必要的包,否则您将得到错误的结果。
\documentclass{ctexbook}
\begin{document}
\chapter{test}
\end{document}
回到你的问题,你的问题在于你加载了sectsty
包。
\documentclass{ctexbook}
\usepackage{sectsty}
\begin{document}
\chapter{test}
\end{document}