1

This question already has an answer here:

EDIT (before publication): I found the answer in this question: Problems with sectioning / toc, but it's a little hidden, so I still choose to publish this question and answer it myself, as I think the question title describes my problem better than the question I extracted the answer from and I estimate it might save somebody else the trouble of looking for the answer in a less specific question. Here comes:

In my document, I have numbered and unnumbered sections. I want both in my ToC. I am almost certain someone else has been looking for a way to achieve this, but I can't even find out how to get to the question I am looking for, so, I'm sorry if this is a duplicate of another question, but I couldn't find it. I'm out of ideas as to what to type in the search field.

\documentclass{article}
\begin{document}
\tableofcontents
\section*{Abbreviations or what have you}
\section{The First Section}
\end{document}

I would like this example to produce:

"

Table of Contents

Abbreviations or what have you ..................1

1 The First Section ......................................2

"

(Trailing dots to "align" the numbers. No dots for sections in normal ToC.)

Could something similar to [heading=bibintoc] be used? This one makes the bibliography appear in the ToC without a number.

Adding unnumbered sections to TOC and other similar questions do not hold the answer to my query, as they seek to take away the numbers to the sections and still make a ToC, but it seems all their sections are unnumbered. I really don't know what to look for. If you don't want to post an answer, but a link to another question with an answer that solves my problem, that's ok with me, of course.

Comments and better answers always welcome. I am a beginner in TeX/LaTeX.

marked as duplicate by user156344, Phelype Oleinik, Andrew Swann, barbara beeton, user170109 May 20 at 15:03

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2

The trick was simple, once I found it

\documentclass{article}
\begin{document}
\tableofcontents
\section*{Abbreviations or what have you}
\addcontentsline{toc}{chapter}{Abbreviations or what have you}
\section{The First Section}
\end{document}

This will add unnumbered sections to the ToC and they will have a page ref like any other section.

Source: Problems with sectioning / toc

Not the answer you're looking for? Browse other questions tagged or ask your own question.