34

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?

2
  • 3
    If you are using the »float« package to create new floats, replace it by the mentioned »tocbasic« package which is part of the KOMA-Script bundle. Its relevant features are described in Section 11.2.3 of the English user guide. Commented Apr 14, 2012 at 7:47
  • 1
    See also: texdoc scrhack
    – user2574
    Commented Apr 14, 2012 at 8:01

1 Answer 1

41

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

6
  • Wait, so this occurs if you've got any floats at all in the document?
    – Robbie
    Commented Apr 22, 2012 at 18:58
  • @zoqaeski: It's related ot \listof... Commented Apr 22, 2012 at 19:28
  • 1
    I tried adding \usepackage{scrhack} and \usepackage{listings} (though I'm not sure if I need that) and I still get that warning.
    – Robbie
    Commented Apr 27, 2012 at 12:08
  • 1
    @zoqaeski: Which version do you use? Commented Apr 27, 2012 at 12:29
  • 1
    shouldn't you load scrhack after listings? Commented Nov 22, 2017 at 7:42

You must log in to answer this question.

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