mgmillani wrote:
Additionally, how would I customize \l@figure
and \l@table
with that? They appear to share the same features as the first depth of the TOC.
Answering my own question: it is possible to use
\settocfeature[toc][1]{entryhook}{\bfseries}
instead of
\settocstylefeature[1]{entryhook}{\bfseries}
to change only the TOC. Using
lot
changes the list of tables and
lof
, the list of figures.
mgmillani wrote:
Unfortunately, I still need to redefine \tocstyle@dottedtocline}, as the dotted line must go until the page number, and I need the page number width for that.
\settocstylefeature{pagenumberbox}
is what I want for that.
I just defined the command:
Code: Select all
\newlength{\dottedspace}
\newcommand{\pnbox}[1]{\settowidth{\dottedspace}{\bfseries#1}\hb@xt@\dottedspace{#1}}
and used it in:
Code: Select all
\settocstylefeature{pagenumberbox}{\pnbox}
The code is much cleaner now:
Code: Select all
\documentclass{report}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[tocindentauto,tocfullflat]{tocstyle}
\settocfeature[toc][0]{entryhook}{\bfseries}
\settocfeature[toc][1]{entryhook}{\bfseries}
\settocstylefeature{pagenumberbox}{\pnbox}
\settocfeature[lof][1]{entryhook}{\figurename~}
\makeatletter
\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{3}
\newlength{\dottedspace}
\newcommand{\pnbox}[1]{\settowidth{\dottedspace}{\bfseries#1}\hb@xt@\dottedspace{#1}}
\renewcommand{\@dotsep}{0}
\makeatother
\begin{document}
\listoffigures
\tableofcontents
\chapter{C}
\section{S}
\subsection{SS}
\chapter{C}
\chapter{C}
\chapter{C}
\chapter{C}
\chapter{C}
\chapter{C}
\chapter{C}
\chapter{C}
\chapter{C}
\chapter{C}
\chapter{C}
\section{S}
\section{S}
\section{S}
\section{S}
\section{S}
\section{S}
\section{S}
\section{S}
\section{S}
\section{S}
\subsection{s}
\subsubsection{SS}
\subsubsection{SS}
\subsubsection{SS}
\subsubsection{SS}
\subsubsection{SS}
\subsubsection{SS}
\subsubsection{SS}
\subsubsection{SS}
\subsubsection{SS}
\subsubsection{SS}
\begin{figure}
\caption{Figures}
\end{figure}
\end{document}
Thanks for pointing this out!