[Tex/LaTex] KOMA and float package – alternative to float [H] placement

floatskoma-script

I am preparing a thesis template (for the blog here http://tex.blogoverflow.com/) and I use a KOMA class together with the float package. I get the nasty warning which is already described and solved in here:

KOMA warning about ToC (\float@addtolists detected!)

I use the float package because of the [H] placement option (place the floating object right 'Here' and nowhere else).

Is there a way to achieve this without the float package? Maybe with the KOMA class?

Best Answer

You can use one of the commands \captionof, \captionaboveof or \captionbelowof defined by the KOMA-Script class:

\documentclass{scrartcl}
\usepackage{mwe}
\begin{document}
\section{Examples}
\blindtext
\begin{center}
  \begin{minipage}{\linewidth}
    \centering
    \captionaboveof{table}{First Table}
    \fbox{Table}
  \end{minipage}
\end{center}
\blindtext
\begin{center}
  \begin{minipage}{\linewidth}
    \centering
    \includegraphics[width=.5\linewidth]{example-image}
    \captionof{figure}{First Image}
  \end{minipage}
\end{center}
\blindtext
\listoffigures
\listoftables
\end{document}

enter image description here

\captionaboveof formats the caption as a heading. So the caption is not too close to the table below. There is also an option that could be used if all table captions are headings: captions=tableheading. Then a caption defined by \captionof{table}{...} is also set with the correct space to the table below.