3

So, I'm getting different sizes of leader dots in the TOC, LOF and LOT. Here's a pretty much MWE in LuaLatex; generated in Lyx:

% Preview source code

%% LyX 2.3.6.1 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[oneside,english]{extbook}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage{graphicx}

% Used for setting up the TOC, LOF & LOT.
\usepackage{tocloft}

\renewcommand{\cftchapfont}{\rmfamily\fontsize{11pt}{11}}
\renewcommand{\cfttabfont} {\rmfamily\fontsize{11pt}{11}}
\renewcommand{\cftfigfont} {\rmfamily\fontsize{11pt}{11}}

\renewcommand\cftchappagefont{\rmfamily\fontsize{11pt}{11}}
\renewcommand\cfttabpagefont {\rmfamily\fontsize{11pt}{11}}
\renewcommand\cftfigpagefont {\rmfamily\fontsize{11pt}{11}}

%Sets the spacing between dots
\renewcommand\cftchapdotsep{\cftdotsep}
\renewcommand\cftfigdotsep{\cftdotsep}
\renewcommand\cfttabdotsep{\cftdotsep}

%Sets the size of the TOC dots.  Comment this out to see normal size dots; but note 
%that the same problem persists.
\newcommand\mydot[1]{\scalebox{#1}{.}}
\renewcommand\cftdot{\mydot{2}}

\makeatother

\usepackage{babel}
\begin{document}
\tableofcontents{}

\listoffigures

\listoftables

\newpage{}

\chapter{Some Chapter}

xyzzy

\begin{figure}
\caption{Some Figure}

\end{figure}

\medskip{}

\begin{table}
\caption{Some Table}

\end{table}

\end{document}

Here's what it looks like:

Dots Silliness

Note that I've added two lines of code in the preamble to make the dots larger. The problem persists when they are commented out, however. I'm using the same font size for the items of each of the three lists. The problem persists if I comment out the code that changes the sizes of the dots, and comment out the \usepackage{graphicx} line. Note that tocloft allows one to specify a custom symbol to use as a dot; but it does not break it out into TOC, LOF and LOT settings.

1 Answer 1

4

The problem here is that the leaders for chapters are set in bold (\bfseries), while those for figures and tables are set in regular font. Update \cftchapleader to not use bold by adding the following to your preamble:

\renewcommand{\cftchapleader}{\cftdotfill{\cftchapdotsep}}

enter image description here

\documentclass[oneside,english]{extbook}

\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}

\usepackage{graphicx}

% Used for setting up the TOC, LOF & LOT.
\usepackage{tocloft}

\renewcommand{\cftchapfont}{\rmfamily\fontsize{11pt}{11}}
\renewcommand{\cfttabfont} {\rmfamily\fontsize{11pt}{11}}
\renewcommand{\cftfigfont} {\rmfamily\fontsize{11pt}{11}}

\renewcommand\cftchappagefont{\rmfamily\fontsize{11pt}{11}}
\renewcommand\cfttabpagefont {\rmfamily\fontsize{11pt}{11}}
\renewcommand\cftfigpagefont {\rmfamily\fontsize{11pt}{11}}

%Sets the spacing between dots
\renewcommand\cftchapdotsep{\cftdotsep}
\renewcommand\cftfigdotsep{\cftdotsep}
\renewcommand\cfttabdotsep{\cftdotsep}

% Remove \bfseries from chapter leader
\renewcommand{\cftchapleader}{\cftdotfill{\cftchapdotsep}}

%Sets the size of the TOC dots.  Comment this out to see normal size dots; but note 
%that the same problem persists.
\newcommand\mydot[1]{\scalebox{#1}{.}}
\renewcommand\cftdot{\mydot{2}}

\begin{document}

\tableofcontents

\listoffigures

\listoftables

\newpage

\chapter{Some Chapter}

xyzzy

\begin{figure}
  \caption{Some Figure}
\end{figure}

\begin{table}
  \caption{Some Table}
\end{table}

\end{document}
4
  • Sure is a long way from intuitive, that tocloft, which is made to make it easier, would NOT change the font of the leader dots, when you change the font of a table entry; and not document the matter.
    – CodeLurker
    Sep 16, 2021 at 15:39
  • @CodeLurker: You can mention this to the package author and suggest a change that would be more dynamic, but still allow for individual changes if some authors want it.
    – Werner
    Sep 16, 2021 at 16:04
  • I will, of course; but now, simply redefining the normal font makes redefining the TOC chapter font ineffective. I'll find out why that's happening, and submit feedback on those together.
    – CodeLurker
    Sep 16, 2021 at 16:10
  • Actually, it had to do with setting the Roman font, and then the font size; whereas it only worked if you do it in the reverse order.
    – CodeLurker
    Sep 18, 2021 at 0:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .