主要說明下標(biāo)題格式的設(shè)置方式郭怪,包括字體、字號皮胡、段前后間距烫罩、標(biāo)題標(biāo)簽等
用\CTEXsetup命令
如下:
\CTEXsetup[name={第,章 },format={\centering\heitiB\zihao{3}},aftername={\enspace},beforeskip={24bp},afterskip={18bp}]{section} %name選項中不要使用中文逗號
\CTEXsetup[format={\raggedright\heiti\zihao{-3}},aftername={\enspace},beforeskip={24bp},afterskip={6bp}]{subsection}
\CTEXsetup[format={\raggedright\heiti\zihao{4}},aftername={\enspace},beforeskip={12bp},afterskip={6bp}]{subsubsection}
存在的還未解決的問題有三點:
字體命令對標(biāo)簽中的數(shù)字編號不起作用
生成的目錄格式?jīng)]有按上面設(shè)置的標(biāo)題格式展示
低一級標(biāo)題緊接高一級標(biāo)題時,兩級標(biāo)題之間的間距以高級標(biāo)題的段后間距為準(zhǔn)约素,而不是以段前間距和段后間距的最大值為準(zhǔn)
修改底層命令(姑且這么說)
如下:
\makeatletter %可行
\renewcommand\section{\@startsection{section}{1}{\z@}%
{24bp\@plus 1ex \@minus .2ex}%
{18bp \@plus .2ex}%
{\heitiB\centering\zihao{3}}}
\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
{24bp\@plus 1ex \@minus .2ex}%
{6bp \@plus .2ex}%
{\heiti\zihao{-3}}}
\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}
{12bp\@plus 1ex \@minus .2ex}%
{6bp \@plus .2ex}%
{\heiti\zihao{4}}}
\makeatother
\renewcommand{\thesection}{第\arabic{section}章}
\renewcommand{\thesubsection}{\arabic{section}.\arabic{subsection}}
\renewcommand{\thesubsubsection}{\arabic{section}.\arabic{subsection}.\arabic{subsubsection}}
第二中方式的三個\renewcommand
可以使目錄中的標(biāo)題展示為我們想要的樣式届良。
但仍存在兩個問題:
字體命令仍不能對數(shù)字編號起作用
\makeatletter
...\makeatother
這種用法不熟悉,而且其中符號\z@
的含義還不清楚
最后給出代碼供大家調(diào)試
\documentclass{ctexart}
%可行
%\CTEXsetup[name={第,章 },format={\centering\heiti\zihao{3}},aftername={\enspace},beforeskip={24bp},afterskip={18bp}]{section} %name選項中不要使用中文逗號
%\CTEXsetup[format={\raggedright\heiti\zihao{-3}},aftername={\enspace},beforeskip={24bp},afterskip={6bp}]{subsection}
%\CTEXsetup[format={\raggedright\heiti\zihao{4}},aftername={\enspace},beforeskip={12bp},afterskip={6bp}]{subsubsection}
\makeatletter %可行
\renewcommand\section{\@startsection{section}{1}{\z@}%
{24bp\@plus 1ex \@minus .2ex}%
{18bp \@plus .2ex}%
{\heiti\centering\zihao{3}}}
\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
{24bp\@plus 1ex \@minus .2ex}%
{6bp \@plus .2ex}%
{\heiti\zihao{-3}}}
\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}
{12bp\@plus 1ex \@minus .2ex}%
{6bp \@plus .2ex}%
{\heiti\zihao{4}}}
\makeatother
\renewcommand{\thesection}{第\arabic{section}章}
\renewcommand{\thesubsection}{\arabic{section}.\arabic{subsection}}
\renewcommand{\thesubsubsection}{\arabic{section}.\arabic{subsection}.\arabic{subsubsection}}
\begin{document}
\tableofcontents
\section{咚咚咚}
\subsection{咚咚咚咚咚}
咚咚咚咚咚咚咚咚咚咚咚咚咚咚咚咚咚咚咚咚\\咚咚咚咚咚咚咚咚咚咚咚咚咚咚咚咚咚咚咚咚
\subsubsection{咚咚咚咚咚咚咚}
咚咚咚咚咚咚咚咚咚咚咚咚咚咚咚咚咚咚咚咚\\咚咚咚咚咚咚咚咚咚咚咚咚咚咚咚咚咚咚咚咚
\section{鏘鏘鏘}
\subsection{鏘鏘鏘鏘鏘}
\subsubsection{鏘鏘鏘鏘鏘鏘鏘}
\end{document}