我在乳胶中使用文档类作为报告,我不想使用文章。现在的问题是,当我在我的文档中使用 section 时,它以 0.0 0.1 0.2 等开头,而不是我想要它作为 1.0 Abstract 1.1 Introduction 等,并且小节应该是 1.0.0 1.0.1 等,并且应该反映到目录中。任何人都请帮我解决这个问题。谢谢你
如果您不使用任何s,则实际上没有必要使用report
(或book
) \chapter
。不过,这是一种方法:
\documentclass{report}
% Subtract 1 from counters that are used
\renewcommand{\thesection}{\thechapter.\number\numexpr\value{section}-1\relax}
\renewcommand{\thesubsection}{\thesection.\number\numexpr\value{subsection}-1\relax}
\renewcommand{\thesubsubsection}{\thesubsection.\number\numexpr\value{subsubsection}-1\relax}
\setcounter{secnumdepth}{3}
\setcounter{chapter}{1}% Not using chapters, but they're used in the counters
\begin{document}
\tableofcontents
\section{First section}
\subsection{First subsection}
\subsubsection{First subsubsection}
\subsubsection{Second subsubsection}
\subsection{Second subsection}
\section{Second section}
\subsection{First subsection}
\subsubsection{First subsubsection}
\end{document}
Run Code Online (Sandbox Code Playgroud)