4

I am wondering how I could change the numbering of some of my sections (not all!) in toc. More precisely, I would like to add a \bullet or something like that to the superscript of their numbers (eg I.10$^\bullet$ <title> instead of I.10 <title>) to let the students know that these sections are not so important, they do not have to read them.

Sigur
  • 37,330

1 Answers1

2

A quick trial solution, by definition of a \notthatimportantsection command which will add a \unimportantindicator to the toc, currently defined as \bullet

\documentclass{article}

\usepackage{etoolbox}%

\let\LaTeXStandardSection\section

\newcommand{\unimportantindicator}{\ensuremath{^{\bullet}}}


\makeatletter

\newcommand{\notthatimportantsection@@noopt}[1]{%
  \notthatimportantsection@@opt[#1]{#1}%
}%


\newcommand{\notthatimportantsection@@opt}[2][]{%
  \let\oldthesection\thesection%
  \begingroup%
  \renewcommand{\addcontentsline}[3]{}%
  \LaTeXStandardSection[]{#2}%
  \endgroup%
  \begingroup%
  \renewcommand{\thesection}{\oldthesection\unimportantindicator}%
  \addcontentsline{toc}{section}{\numberline{\thesection~#1}}%
  \endgroup%
}%

\newcommand{\notthatimportantsection}{%
  \@ifnextchar[{\notthatimportantsection@@opt}{\notthatimportantsection@@noopt}
}%

\makeatother


\usepackage{blindtext}


\begin{document}


\tableofcontents



\section{Important}

\blindtext

\notthatimportantsection[Unimportant]{This is not really important}

\notthatimportantsection{Also not important}

\section{Important again}

\end{document}

enter image description here

  • May be \rlap{$^{\bullet}$} and then using the default spacing rather than \thesection~#1 (that ~ is not perfect there). – Manuel Oct 22 '14 at 22:57
  • You should take a look at the titlesec/titletoc documentation, § 4.3 and 6.7. An environment and a marker for advanced sections is defined, and how to enter them in the table of contents with their marker. – Bernard Oct 22 '14 at 23:10
  • @Bernard: I will look later on... and think about a better solution, as I am not satisfied with this completely. –  Oct 23 '14 at 00:04