
Wie entferne ich „Was auch immer es ist“ nur aus den beiden Mini-Inhaltsverzeichnissen? (Ich möchte, dass es im Haupt-Inhaltsverzeichnis bleibt.)
\documentclass[notoc]{tufte-book}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\begin{document}
\tableofcontents
\chapter{Introduction}
\startcontents[chapters]
\printcontents[chapters]{}{1}{}
\section{Historical Overview}
\section{The CUDA Model}
\section{A Lattice Boltzmann Solver}
\stopcontents[chapters]% doesn't work
\addtocontents{toc}{Whatever it is\endgraf}
\resumecontents[chapters]% doesn't work
\chapter{Foo Bar}
\startcontents[chapters]
\printcontents[chapters]{}{1}{}
\section{My Overview}
In this chapter we first...
\end{document}
Antwort1
Es ist besser, den „zufälligen Text“ im Inhaltsverzeichnis als eine Art Abschnittseinheit zu assoziieren. So wie Sie chapter
, section
, ... haben, nennen wir es special
:
\documentclass[notoc]{tufte-book}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\makeatletter
\newcommand{\l@special}[2]{#1\endgraf}
\makeatother
\begin{document}
\tableofcontents
\chapter{Introduction}
\startcontents[chapters]
\printcontents[chapters]{}{1}{}
\section{Historical Overview}
\section{The CUDA Model}
\section{A Lattice Boltzmann Solver}
\stopcontents[chapters]
\addcontentsline{toc}{special}{Whatever it is}
\resumecontents[chapters]
\chapter{Foo Bar}
\startcontents[chapters]
\printcontents[chapters]{}{1}{}
\section{My Overview}
In this chapter we first...
\end{document}
Wir definieren \l@special
die Verarbeitung des Sondereintrags im Inhaltsverzeichnis. In diesem Fall schreiben Sie einfach, was darin enthalten ist.