簡體   English   中英

如何將我的章節編號保留在Latex中,但只是隱藏它?

[英]How do I keep my section numbering in Latex but just hide it?

我需要這樣的東西:

第1章

預賽

1.1 Banach代數

我試過這個:

\chapter{}
\section*{Preliminaries}
\subsection{Banach Algebras}

問題是:只要我使用\\section*{Preliminaries}隱藏節號,就會將子節的編號更改為0.1 Banach Algebras

如何隱藏該部分的編號,但在我的小節中保留編號?

快速修復沒有更新section命令的麻煩是使用addtocounter。

每次使用\\ section * {}命令時,您都可以說\\ addtocounter {section} {1}

\chapter{}
\section*{Preliminaries}
\addtocounter{section}{1}
\subsection{Banach Algebras}

\section*{Preliminaries}
\addtocounter{section}{1}
\subsection{Banach Algebras}

這會給你一個結果,

Chapter 1
Preliminaries
1.1.1 Banach Algebras
Preliminaries
1.2.2 Banach Algebras

基本上,每當你創建一個部分時,它只是在你的部分計數器中加1,所以當子部分檢查部分計數器時,它有更新的計數器。

而且優點是如果你現在添加另一個需要編號的部分,

\chapter{}
\section*{Preliminaries}
\addtocounter{section}{1}
\subsection{Banach Algebras}

\section*{Preliminaries}
\addtocounter{section}{1}
\subsection{Banach Algebras}

\section{Preliminaries}

您將獲得正確的部分編號(即1.3)

Chapter 1
Preliminaries
1.1.1 Banach Algebras
Preliminaries
1.2.2 Banach Algebras
1.3 Preliminaries

主要缺點是每次創建\\ section * {}時都必須記住添加到計數器

每次創建其中一個部分以重置子部分計數器時,您都可以添加\\ setcounter {subsection} {0} ...抱歉,我錯過了那個。 謝謝你的澄清。

所以你只是不想看到顯示的數字? 只需使用\\ renewcommand更新\\ section命令,如下所示:

\renewcommand{\thesection}{}

這里也提出同樣的問題, @ zwol 接受的回答就像我想要的那樣。

我認為你最好的選擇是重新定義\\thesection ,這是通常打印節號的宏。

 \\renewcommand\\thesection{} 

如果您希望子部分編號包含未打印的部分編號,您還需要重新定義\\thesubsection ,通常調用\\thesection

 \\makeatletter \\renewcommand\\thesection{} \\renewcommand\\thesubsection{\\@arabic\\c@section.\\@arabic\\c@subsection} \\makeatother 

如果您正在使用KOMA腳本文檔類(例如,scrartcl),請在您的序言中包含

\renewcommand*{\sectionformat}{}

\\ subsectionformat,\\ subsubsectionformat,\\ paragraphformat和\\ subparagraphformat也適用於您使用\\ setcounter {secnumdepth} {}設置的任何深度。 雖然您隱藏了計數器標簽,但計數器仍會對該部分進行計數,並將其包含在TOC和書簽中。 (已加載hyperref和書簽包測試。)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM