I am using scrbook document class. I've created my own environment named example and I wanted to create "List of examples." In that name I've loaded package tocloft.
However as much as I try, the "List of examples" is formatted differently than other lists, like "List of tables" or "List of figures": horizontal spacing is substantially smaller for "List of Examples".
I've tried everything, including option titles, which only makes things worse, changing vertical spacing.
Please help me format "List of examples" just like the other lists.
Here is MWE:
\documentclass[11pt,parskip=half,numbers=noenddot,bibliography=totoc,index=totoc]{scrbook}
\usepackage{tcolorbox,etoolbox}
% Adding option `titles' makes it worse
\usepackage{tocloft}
\newcommand{\listexamplename}{List of examples}
\newlistof[chapter]{example}{loe}{\listexamplename}
\renewcommand{\theexample}{\thechapter.\arabic{example}}
\newenvironment{example}[1]{\refstepcounter{example}\addcontentsline{loe}{example}{\protect\numberline{\theexample}{\ignorespaces #1}}\par\begin{tcolorbox}[title=Example\ \theexample:\ #1]}{\end{tcolorbox}}
% For list of examples, make space between chapters
\makeatletter
\preto\chapter{\addtocontents{loe}{\protect\addvspace{10\p@}}}%
\makeatother
\begin{document}
\chapter{First}
\begin{example}{First example.}
\end{example}
\begin{table}
\caption{First graph.}
\end{table}
\chapter{Second}
\begin{example}{Second example.}
\end{example}
\begin{table}
\caption{Second graph.}
\end{table}
\begin{example}{Third example.}
\end{example}
\begin{table}
\caption{Third graph.}
\end{table}
\chapter{Lists}
\listoftables
\listofexample
\end{document}


listof=leveldownand\setuptoc{loe}{chapteratlist,leveldown}, or at least make a comment. They are included into solution only to adapt to MWE, which usestocbasic. I have removed them for my use. – Pygmalion Sep 16 '15 at 13:24leveldown. But\setuptoc{loe}{chapteratlist}is used to insert the gap between the entries of different chapters in the list. (You have usedetoolboxin your example to insert a similar gap). If there should be no gap in all lists usechapteratlists=0ptas class option. – esdd Sep 16 '15 at 13:48\setuptoc{loe}{totoc}– Dr. Manuel Kuehner Jan 04 '20 at 12:52