Text Formattingreflecting un-numbered sections in ToC

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
Sekantombi
Posts: 21
Joined: Mon Apr 21, 2008 3:50 am

reflecting un-numbered sections in ToC

Post by Sekantombi »

Dear Colleagues -

How do you arrange things so that you have un-numbered sections in LaTeX and still have them reflected in the ToC?

Of course, would still like to have numbered chapters ...

Many thanks -

-Sekantombi

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

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

rais
Posts: 419
Joined: Sun Nov 16, 2014 8:51 pm

reflecting un-numbered sections in ToC

Post by rais »

Sekantombi wrote:How do you arrange things so that you have un-numbered sections in LaTeX and still have them reflected in the ToC?

Of course, would still like to have numbered chapters ...
you could set the secnumdepth counter to zero (nothing below chapter will be numbered in text)

Code: Select all

\documentclass{report}
\setcounter{secnumdepth}{0}
\begin{document}
\tableofcontents
\chapter{foo}
\section{bar}
\end{document}
KR
Rainer
Sekantombi
Posts: 21
Joined: Mon Apr 21, 2008 3:50 am

Re: reflecting un-numbered sections in ToC

Post by Sekantombi »

Thanks - this looks do-able -

- Sekantombi
Post Reply