General ⇒ Table of Contents - How to show everything? Sections missing
Table of Contents - How to show everything? Sections missing
I am new to LaTeX, and I am trying to write my university dissertation in it...good times.
I'm trying to get my contents page to display all my sections and subsections...at the moment it only displays 4/5 from each chapter but I need it to show all.
I saw the /addtocontents command, but I have many sections and I don't want to have to do that for all of them.
Thanks in advance for your help
IJC
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
Table of Contents - How to show everything? Sections missing
Code: Select all
\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{5}
Table of Contents - How to show everything? Sections missing
Now all the Chapters, Sections and Sub-Sections appear.

Now though, there are not any Sub-Sub-Sections on the contents...
I tried an inventive command \setcounter{subsecnumdepth}{5} but the compiler had no idea what I was talking about

IJC
Table of Contents - How to show everything? Sections missing
Code: Select all
command | level
--------------------------------------
\part | -1 (book and report) 0 (article)
\chapter | 0 (book and report only)
\section | 1
\subsection | 2
\subsubsection | 3
\paragraph | 4
\subparagraph | 5
Table of Contents - How to show everything? Sections missing
At the moment using
Code: Select all
\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{5}
Thanks for you help, it's much appreciated
Table of Contents - How to show everything? Sections missing
The secnumdepth counter controls the nesting level up to which numbering will be produced. The tocdepth counter controls the nesting level up to which sectional units will be included in the ToC.The standard LaTeX document classes (book, report, article) provide commands to define the hierarchical structural units of a document (parts, chapters, sections, etc.). Each such command defines a nesting level inside a hierarchy and each structural unit belongs to some level.
Standard LaTeX provides the set of sectioning commands I mentioned in my previous post. The \chapter command defines level zero of the hierarchical structure of a document, \section defines level one, and so on (the optional \part command defines level minus one (in book and report) or zero (in article, since the article class does not have \chapter))
The following example shows how every sectioning command down to \subparagraph will be numbered and will appear in the Table of Contents (ToC):
Code: Select all
\documentclass{book}
\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{5}
\usepackage{blindtext}
\begin{document}
\tableofcontents
\chapter{a}
\blindtext
\section{b}
\blindtext
\subsection{c}
\blindtext
\subsubsection{d}
\blindtext
\paragraph{e}
\blindtext
\subparagraph{f}
\blindtext
\end{document}
Remark: the blindtext package was loaded only to automatically generate some text.
Table of Contents - How to show everything? Sections missing
Code: Select all
\documentclass[parskip]{cs4rep} %cs4rep is a template they want us to conform too
\usepackage[pdftex]{graphicx}
\usepackage{a4wide}
....
\tableofcontents
\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{5}
.....
\chapter{Design}
\section{Specifications}
\section{Major Design Decisions}
\subsection{PicoBlaze}
\subsubsection{PicoBlaze ADC}
\subsection{Fast Fourier Transform}
\subsubsection{Self-coded in Verilog}
\subsubsection{Pre-made Verilog module}
\subsubsection{Xilinx LogiCore}
\subsection{Output Stage}
\subsubsection{On-board LCD}
\subsubsection{VGA Port}
\subsubsection{Data Output Port}
.....
Table of Contents - How to show everything? Sections missing
Code: Select all
%%% Table of contents to list down to subsections and no further
\setcounter{tocdepth}{2}
%%% Number down to subsubsections only
\setcounter{secnumdepth}{3}
Edit: Now that I read more carefully your last post, maybe it is enough to place the \setcounter commands I suggested you in the preamble of your document (before the \begin{document} line).
Re: Table of Contents - How to show everything? Sections missing

I put the commands above the \begin{document} line and it worked beautifully.
I won't be submitting my report with the larger contents page, but it's going to help me a lot with writing/planning it.
Thanks very much for your help!