# Have unnumbered sections appear in ToC along numbered ones [duplicate]

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:

"

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

The trick was simple, once I found it

\documentclass{article}
\begin{document}
\tableofcontents
\section*{Abbreviations or what have you}

• If you don't want to have to write \addcontentsline… for each unnumbered section, you can automate it with titlesec, via titleformat{name=\section}, numberless}{…}. – Bernard Mar 12 '17 at 23:46