0

This question already has an answer here:

I have several section* 's in my LaTex text. But I only want the first one (abstract) to appear in the list of contents, although without a number. All the other section* 's are just a few subheadlines which should not appear anywhere and also don't have a number so far, which is good. Is there any exception regulation for this case only?

marked as duplicate by Marco Daniel, Dror, lockstep, Svend Tveskæg, karlkoeller Jan 31 '14 at 12:48

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.

  • 1
    \addcontentsline{toc}{section}{Abstract} – Steven B. Segletes Jan 31 '14 at 12:19
  • Which documentclass? If you use KOMA you can use \addsec – Marco Daniel Jan 31 '14 at 12:19
  • Are you sure you want to use \section* and not something like \paragraph? – Dror Jan 31 '14 at 12:20
0

KOMAscript solution:

\documentclass{scrartcl}
\newcommand{\Section}[1]{%
  \section*{#1}
  \addxcontentsline{toc}{section}{#1}
}

\begin{document}
\tableofcontents
\Section{Abstract}
\begin{abstract}
This is my abstract
\end{abstract}
\section{First section}
This is my text.
\end{document}

In older versions of KOMAscript and with other document classes you’d probably have to use \addcontentsline instead of \addxcontentsline (note the x), or load \usepackage{tocbasic}. As far as I know the only difference is whether the option numberline is supported for unnumbered TOC entries.

Other than that this answer has been given before.

0

You can also try something like this:

\begin{document}

\tableofcontents{
\addcontentsline{toc}{section}{Abstract}
}


\section*{Abstract}

\section*{First Section}

\section*{Second Section}

\end{document}

Which has this output:

enter image description here

  • Yes, this works, but I want to have all the other section* 's I used so far not to do the same, like they should not be in the list of content. So it's just for this one exception! – UserSoUndSo Jan 31 '14 at 15:14

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