I've been working with the ToC, LoF, LoT and more recently with the LoA (List of Algorithms) of my dissertation. I'm using the tocloft package so I can set their styles the way I want. My first problem was making these dots closer. I resolved that by renewing some commands and removing the separators from them.
I'm using the algorithm2e package to manage my algorithms and get the command \listofalgorithms. The index is well generated but the dots are still separated. I've tried to use the \newlistof but it didn't work. Also using renewing the command \renewcommand{\cftalgorithmleader}{~\cftdotfill{}} but it says that \cftalgorithmleader is undefined.
Here we have a minimal example of the problem where the dots are still separated in the list of algorithms.
\documentclass[10pt]{book}
\usepackage[utf8]{inputenc}
\usepackage[portuguese,algosection,algoruled,linesnumbered]{algorithm2e}
\usepackage[titles]{tocloft}
\renewcommand{\cftchapleader}{~\cftdotfill{}}
\renewcommand{\cftsubsecleader}{~\cftdotfill{}}
\renewcommand{\cftsubsubsecleader}{~\cftdotfill{}}
\renewcommand{\cftsecleader}{~\cftdotfill{}}
\renewcommand{\cftfigleader}{~\cftdotfill{}}
\renewcommand{\cfttableader}{~\cftdotfill{}}
\renewcommand{\cftpartleader}{~\cftdotfill{}}
\renewcommand{\cftparaleader}{~\cftdotfill{}}
% \renewcommand{\cftalgorithmleader}{~\cftdotfill{}}
\begin{document}
\tableofcontents
\listofalgorithms
\chapter{One}
\section{OnedotOne}
\begin{algorithm}[H]
\SetAlgoLined
\KwData{this first text}
\caption{first algorithms}
\end{algorithm}
\chapter{Two}
\section{TwodotOne}
\begin{algorithm}[H]
\SetAlgoLined
\KwData{this second text}
\caption{second algorithms}
\end{algorithm}
\end{document}
