如何以 0.0 開始一個部分?

如何以 0.0 開始一個部分?

我該如何添加“簡短的前言”部分?我知道\section*{0.0 A Short Preface}可能沒問題,但 TeX 很棒,而且一定有更好的方法。

這就是我正在尋找的內容(在 Google Docs 中完成):

在此輸入影像描述

謝謝!

答案1

最簡單的是,將節計數器設定為-1將會導致下一個節為0

\documentclass{book}
\begin{document}
\setcounter{section}{-1}
\section{text}
\end{document}

若要變更分段的外觀,例如預設新增分段編號,\thesection還需要重新定義 。

\documentclass{article}
\usepackage{lipsum}
\renewcommand\thesection{\arabic{section}.\arabic{subsection}}
\begin{document}
\setcounter{section}{-1}
\section{A Short Preface}
\lipsum[1]
\section{Introduction}
\lipsum[2]
\end{document}

在此輸入影像描述

答案2

編輯:更新為xassocnt v.0.8-- 使用級聯暫停計數器,即計數器重設清單中的所有計數器都將暫停:

\documentclass{book}

\usepackage{xassoccnt}
\usepackage{blindtext}


\setcounter{secnumdepth}{4}
\begin{document}
\tableofcontents
\listoffigures
\listoftables


\CascadeSuspendCounters{chapter}
\chapter{The first chapter}
\section{Foo}


\begin{figure}

\caption{A foo figure}
\end{figure}

\begin{table}
\caption{A foo table}
\end{table}



\subsection{My First subsection}
\blindtext
\section{Foobar}
\subsection{Foobar subsection}
\blindtext
\subsubsection{Foobar Again}
\blindtext


\ResumeAllSuspendedCounters

\chapter{Another chapter}


\begin{figure}
\caption{Another figure}
\end{figure}



\SuspendCounters{chapter,section}

\chapter{Yet another chapter}

\section{Foo section in yet another chapter}

\begin{figure}
\caption{Another figure}
\end{figure}



\end{document}

使用\SuspendCountersfromxassoccnt來固定計數器並稍後恢復它們。

\documentclass{article}

\usepackage{xassoccnt}
\usepackage{blindtext}
\begin{document}

\SuspendCounters{section}
\SuspendCounters{subsection}
\section{Foo}
\subsection{My First subsection}
\blindtext
\ResumeSuspendedCounters{section}
\ResumeSuspendedCounters{subsection}
\section{Foobar}
\blindtext
\end{document}

在此輸入影像描述

相關內容