[Tex/LaTex] KOMA warning about ToC

koma-scripttable of contentswarnings

Lately I've noticed the following warning from KOMA when I compile my documents:

Class scrreprt Warning: \float@addtolists detected!
(scrreprt)              You should use the features of package `tocbasic'
(scrreprt)              instead of \float@addtolists.
(scrreprt)              Support for \float@addtolists may be removed from
(scrreprt)              `scrreprt' soon .

The documentation for KOMA makes a brief mention of package \tocbasic but none of the examples there mention anything about \float@addtolists, unless this information is in the German documentation and hasn't been translated to English yet.

What does the warning mean, and can anyone suggest what changes I can make to silence it?

Best Answer

KOMA uses his own algorithm to create float environments provided by tocbasic.

So packages like float or listings uses an old version and produce this warning. However Markus Kohm wrote a small package named scrhack fixing this issue.

Example 1 without scrhack:

\documentclass{scrartcl}

\usepackage{listings}
\begin{document}
\lstlistoflistings 


\begin{lstlisting}[caption={example}]
 for i=1 by 1 to 10 do
   i++
 od:
\end{lstlisting}
\end{document}

Warning:

Class scrartcl Warning: Usage of deprecated \float@listhead!
(scrartcl)              You should use the features of package `tocbasic'
(scrartcl)              instead of \float@listhead.
(scrartcl)              Definition of \float@listhead my be removed from
(scrartcl)              `scrartcl' soon, so it should not be used  on input lin
e 5.

Example 2 with scrhack

\documentclass{scrartcl}
\usepackage{scrhack}
\usepackage{listings}
\begin{document}
\lstlistoflistings 


\begin{lstlisting}[caption={example}]
 for i=1 by 1 to 10 do
   i++
 od:
\end{lstlisting}
\end{document}

0 warnings