I want to change the appearance of my listoffigures, listoftables, and listofschemes with KOMA script commands.
I use the scheme environment from the chemmacros package.
Here is my MWE:
\documentclass[fontsize=10pt,
twoside,
paper=b5,
pagesize=auto,
numbers=noenddot, % Removes ending point after heading- and caption numbers.
toc=bibliography, % Includes bibliography into ToC but without numbering it.
listof=totoc, % Includes all lists (figures, etc.) into ToC but without numbering.
open=right, % Start new chapters on a right page (doublepage layout).
singlespacing=true, % KOMA-script. p 450ff. setspace only in textbody.
chapterprefix=true,
appendixprefix=true
]{scrreprt}
%
\usepackage{scrhack} % Patches for KOMA-script.
\usepackage[american]{babel}
\usepackage{amsmath}
\usepackage[final,tracking=true]{microtype}
\usepackage{fontspec}
\defaultfontfeatures{
Ligatures = TeX ,
RawFeature={+calt} ,
SmallCapsFeatures={Letters=SmallCaps}
}
\usepackage[math-style=ISO,
bold-style=ISO]{unicode-math}
\usepackage{libertinus}
%
\usepackage{blindtext}
%
%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{float}
\usepackage{chemmacros}
\usechemmodule{mechanisms,%
redox,%
spectroscopy,%
units,%
scheme}
\AtBeginDocument{\renewcommand{\thescheme}{\arabic{chapter}.\arabic{scheme}}}
%%%%%%%%%%%%%%%%%%%%%%%%
%
\DeclareTOCStyleEntry[indent=0em,numwidth=2.3em]{dottedtocline}{figure}
\DeclareTOCStyleEntry[indent=0em,numwidth=2.3em]{dottedtocline}{scheme}
%
%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
%
\blindtext
%
\begin{figure}[H]
\caption{blabla}
\label{fig:1}
\end{figure}
\begin{figure}[H]
\caption{blabla}
\label{fig:2}
\end{figure}
\begin{figure}[H]
\caption{blabla}
\label{fig:3}
\end{figure}
\begin{figure}[H]
\caption{blabla}
\label{fig:4}
\end{figure}
%
\blindtext
%
\begin{scheme}[H]
\caption{blabla}
\label{scheme:1}
\end{scheme}
\begin{scheme}[H]
\caption{blabla}
\label{scheme:2}
\end{scheme}
\begin{scheme}[H]
\caption{blabla}
\label{scheme:3}
\end{scheme}
\begin{scheme}[H]
\caption{blabla}
\label{scheme:4}
\end{scheme}
%
\blindtext
%
\listoffigures
\listofschemes
%
\end{document}
While
\DeclareTOCStyleEntry[indent=0em,numwidth=2.3em]{dottedtocline}{figure}
works nice for figures and tables (not shown), trying to do the same for the scheme environment results in the following error:
! Package tocbasic Error: toc style `dottedtocline' needs toc entry level.
See the tocbasic package documentation for explanation.
Type H <return> for immediate help.
...
l.42 ...t=0em,numwidth=2.3em]{dottedtocline}{scheme}
Usually the toc entry level is defined using option `level'.
In some cases it may be set defining command `\schemetocdepth'.
If you'll continue, I'll ignore the command. This could result in
further error messages.
According to the chemmacros documentation, the scheme environment should be compatible with KOMA script, so I wonder what causes the error in the .log file.
The output is also not consistent, as the listoffigures is formatted according to the commands, while the listofschemes is still starting with an indent, see pictures below:
Any ideas how to solve this formatting issue?