在...的帮助下
\makeatletter
\patchcmd{\@makechapterhead}% <cmd>
{\thechapter}% <search>
{\expandafter\ifx\@chapapp\appendixname\else\ifnum\value{chapter}<10
0\fi\fi\thechapter}% <replace>
{}{}% <success><failure>
\makeatother
我能够将章节编号\documentclass[12pt,a4paper]{report}
从Chapter 1
、、、等更改为、、、等Chapter 2
。Chapter 3
Chapter 01
Chapter 02
Chapter 03
但在章节内编写节时,其编号以1
、、等开头2
。3
我希望我的章节看起来像、、、Chapter 01
等等,我的部分看起来像、、、等等,我的Chapter 02
小节看起来像、、、、、等等。Chapter 03
Chapter 01
1.1
1.2
1.3
Chapter 01
1.1.1
1.1.2
1.2.1
1.2.2
1.2.3
我如何在\documentclass[12pt,a4paper]{report}
文档中做到这一点?
编辑:我的完整代码:
\documentclass[12pt,a4paper]{report}
\usepackage[UKenglish]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[activate={true,nocompatibility},final,tracking=false,kerning=true,spacing=true,factor=1100,stretch=10,shrink=10]{microtype}
\DisableLigatures[f]{encoding = T1}
\usepackage{etoolbox}
\microtypecontext{spacing=nonfrench}
\usepackage{geometry}
\usepackage{hanging}
\newlength{\hangwidth}
\newcommand{\myhang}[1]{\settowidth{\hangwidth}{#1}\hangpara{\hangwidth}{1}#1}
\geometry{
left=2cm,
right=2cm,
top=2cm,
bottom=2cm,
bindingoffset=0mm
}
\makeatletter
\patchcmd{\@makechapterhead}% <cmd>
{\thechapter}% <search>
{\expandafter\ifx\@chapapp\appendixname\else\ifnum\value{chapter}<10
0\fi\fi\thechapter}% <replace>
{}{}% <success><failure>
\makeatother
\renewcommand{\thesection}{\arabic{section}}
\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{5}
\begin{document}
\begin{titlepage}
\vspace*{2cm}
\centering
{\scshape\LARGE Title page\par}
\end{titlepage}
\cleardoublepage
\pagenumbering{Roman}
\tableofcontents
\cleardoublepage
\pagenumbering{arabic}
\setcounter{chapter}{0}
\chapter{One}
\section{First section}
\end{document}
答案1
我找到了解决方案。只需删除\renewcommand{\thesection}{\arabic{section}}
它就可以了。我乍一看没有看到它,而且它没有提供原始问题。