Latex 撰写中文书籍 book 时,默认各个章节会显示英文格式的 Chaper 1、Chaper 2 等,此时需要将 Chaper 转换显示为“第几章”格式:

\documentclass{book}
\usepackage[utf8]{inputenc}
\usepackage{CTEX}
\begin{document}
\tableofcontents
\chapter{本书第一章}
\section{章节}
这是一个 section 部分内容
\subsection{子章节}
这是一个 subsection 部分内容
\subsubsection{子子章节}
这是一个 subsubsection 部分内容
\paragraph{段落}
这是一个 paragraph 部分内容
\paragraph{子段落}
这是一个 paragraph 部分内容
\end{document}
在 \begin{document} 前前添加自定义的章节中文格式即可:
\usepackage[center]{titlesec}%chapter1修改为第1章
\titleformat{\chapter}{\raggedright\Huge\bfseries}{第\,\thechapter\,章}{1em}{}
\titleformat{\section}{\raggedright\Large\bfseries}{\,\thesection\,}{1em}{}
\titleformat{\subsection}{\raggedright\large\bfseries}{\,\thesubsection\,}{1em}{}

\documentclass{book}
\usepackage[utf8]{inputenc}
\usepackage{CTEX}
\usepackage[center]{titlesec}%chapter1修改为第1章
\titleformat{\chapter}{\raggedright\Huge\bfseries}{第\,\thechapter\,章}{1em}{}
\titleformat{\section}{\raggedright\Large\bfseries}{\,\thesection\,}{1em}{}
\titleformat{\subsection}{\raggedright\large\bfseries}{\,\thesubsection\,}{1em}{}
\begin{document}
\tableofcontents
\chapter{本书第一章}
\section{章节}
这是一个 section 部分内容
\subsection{子章节}
这是一个 subsection 部分内容
\subsubsection{子子章节}
这是一个 subsubsection 部分内容
\paragraph{段落}
这是一个 paragraph 部分内容
\paragraph{子段落}
这是一个 paragraph 部分内容
\end{document}
本文介绍如何在使用Latex撰写中文书籍时,将默认的英文章节标题格式(如Chapter1)转换为中文格式(如第1章)。通过自定义标题格式,可以实现更加符合中文阅读习惯的章节标题展示。
4849

被折叠的 条评论
为什么被折叠?



