
Como remover "Seja lá o que for" apenas dos dois mini ToCs? (Quero que permaneça no ToC principal.)
\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}
Responder1
É melhor associar o “texto aleatório” dentro do ToC como sendo alguma forma de unidade seccional. Assim como você tem chapter
, section
, ..., vamos chamá-lo de 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}
Definimos \l@special
como lidar com a entrada especial no ToC... neste caso, basta escrever o que ela contém.