我想知道如何更改部分章节(不是全部!)的编号toc
。更准确地说,我想\bullet
在编号的上标中添加 或类似的内容(例如,I.10$^\bullet$ <title>
而不是I.10 <title>
),以便让学生知道这些章节并不那么重要,他们不必阅读它们。
答案1
一个快速的试验解决方案,通过定义一个\notthatimportantsection
命令,将一个添加\unimportantindicator
到目录中,当前定义为\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}