Text Formatting ⇒ numbered section not in TOC
numbered section not in TOC
how can I avoid that a numbered section gets listed in the TOC?
What I already know:
\section{example} leads to a numbered new section which gets listed in the TOC.
\section*{example} leads to a new section which is not listed in the TOC but also gets no number. But I need a number for the section because I want to refer to the section.
Thanks in advance.
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
numbered section not in TOC
Code: Select all
\section*{\refstepcounter{section}\thesection\quad Section Title}
Re: numbered section not in TOC
\section*{\refstepcounter{section}\thesection\quad Section Title}\label{Section Title}
But in this case \ref{Section Title} does not refer to the correct section (let´s say A.1 in the appendix) but just to the chapter (i.e. A). How can I manage that the ref command refers to the correct section?
numbered section not in TOC
Code: Select all
\section*{\refstepcounter{section}\label{mylabel}\thesection\quad Section Title}
Code: Select all
\refstepcounter{section}\section*{\thesection\quad Section Title}\label{mylabel}
Re: numbered section not in TOC
I modified it a bit (probably very dowdy). With your proposal the number of the section looks like 1.1 but because all other section numbers in my text have the form 1.1. I simply wrote
\section*{\refstepcounter{section}\label{mylabel}\thesection.\quad Section Title}
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
numbered section not in TOC
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10