gpt4 book ai didi

latex 部分从 0.1 开始而不是 1.1

转载 作者:行者123 更新时间:2023-12-01 08:50:10 24 4
gpt4 key购买 nike

我在 latex 中使用文档类作为报告,我不想使用文章。现在的问题是,当我在文档中使用部分时,它以 0.0 0.1 0.2 等开头,而不是我希望它为 1.0 Abstract 1.1 Introduction 等,小节应该是 1.0.0 1.0.1 等,并且应该反射(reflect)在目录中。任何人都请帮我解决这个问题。谢谢你

最佳答案

如果您不使用任何 \chapter,则没有真正需要使用 report(或 book)。不过,这是一种方法:

enter image description here

\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}

关于 latex 部分从 0.1 开始而不是 1.1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28271204/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com