
Как удалить «Whatever it is» только из двух мини-оглавлений? (Я хочу, чтобы оно осталось в основном оглавлении.)
\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}
решение1
Лучше ассоциировать "случайный текст" в ToC как некую форму секционной единицы. Так же, как у вас есть chapter
, section
, ..., давайте назовем это 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}
Мы определяем \l@special
обработку специальной записи в ToC... в этом случае просто пишем все, что она содержит.