\ctexset{
section = {
format+ = \zihao{-4} \heiti \raggedright,
name = {,、},
number = \chinese{section},
beforeskip = 1.0ex plus 0.2ex minus .2ex,
afterskip = 1.0ex plus 0.2ex minus .2ex,
aftername = \hspace{0pt}
},
subsection = {
format+ = \zihao{5} \heiti \raggedright,
% name={\thesubsection、},
name = {,、},
number = \arabic{subsection}
beforeskip = 1.0ex plus 0.2ex minus .2ex,
afterskip = 1.0ex plus 0.2ex minus .2ex,
aftername = \hspace{0pt}
}
}
请提供完整的示例代码
把所有的代码用代码块包起来
\documentclass{book}
\usepackage[heading=true]{ctex} % 加 heading=true 才可以调整标题格式
%正文区(文稿区)
%======设置标题的格式======
\ctexset{ % 不要用空行
section = {
% format+ = \zihao{-4} \heiti \raggedright,
name = { ,、},
number = \chinese{section},
beforeskip = 1.0ex plus 0.2ex minus .2ex,
afterskip = 1.0ex plus 0.2ex minus .2ex,
aftername = \hspace{0pt}
},
subsection = {
format+ = \zihao{5} \heiti \raggedright,
% name={\thesubsection、},
name = { ,、},
number = \arabic{subsection}, % 这里缺个逗号
beforeskip = 1.0ex plus 0.2ex minus .2ex,
afterskip = 1.0ex plus 0.2ex minus .2ex,
aftername = \hspace{0pt}
}
}
\begin{document}
\tableofcontents
\chapter{绪论}
\section{研究的目的和意义}
\section{国内外研究现状}
\subsection{国外研究现状}
\subsection{国内研究现状}
\section{研究内容}
\section{研究方法与技术路线}
\subsection{研究内容}
\subsection{技术路线}
\chapter{实验与结果分析}
\section{引言}
\section{实验方法}
\section{实验结果}
\subsection{数据}
\subsection{图表}
\subsubsection{实验条件}
\subsubsection{实验过程}
\subsection{结果分析}
\section{结论}
\section{致谢}
\end{document}
关于 heading=true
的说明在 texdoc ctex
windows10 texlive2021 texstudio xelatex
%导言区
documentclass{book}
usepackage{ctex}
%正文区(文稿区)
%======设置标题的格式======
ctexset{
}
begin{document}
end{document}
@u50882 我更新了回答
@u3793 您好,我复制了您的代码,编译后报错如下
行 13: Unknown option
heading=true' for package
ctex'.行 8: Undefined control sequence. ctexset
行 9: Missing begin{document}. ^^Is
行 11: Undefined control sequence. ^^I^^Iname = { ,、
行 11: Undefined control sequence. ^^I^^Iname = { ,、
行 11: Undefined control sequence. ^^I^^Iname = { ,、
行 11: Undefined control sequence. ^^I^^Iname = { ,、
行 11: Undefined control sequence. ^^I^^Iname = { ,、
行 11: Undefined control sequence. ^^I^^Iname = { ,、
行 12: Undefined control sequence. ^^I^^Inumber = chinese{section}
行 12: Undefined control sequence. ^^I^^Inumber = chinese{section}
: You have requested package
savesym', but the package provides
savesymbol'.: No file 4.toc.
行 41: Font shape
EU1/SimSun(0)/m/sl' undefined(Font) using
EU1/SimSun(0)/m/n' instead: Some font shapes were not available, defaults substituted.
@u50882 emmm,你把代码中所有的缩进重新用空格打一遍,或者直接不要缩进
@u50882 或者我在代码上给了你修改意见,你直接按照意见修改你自己的代码也可以
@u3793 还是不行,我放弃了,非常感谢您的回答!