I like captions to normally have a colon, but not when the caption is empty. This is something that the package caption
does automatically, so
\documentclass{scrartcl}
\usepackage{caption}
\begin{document}
\begin{figure}
\caption{Test}
\caption{}
\end{figure}
\end{document}
yields "Figure 1: Test / Figure 2".
That is all very fine, but I want to use KOMA captions without the caption
package, and then I get "Figure 1: Test / Figure 2:" with the extra colon at the end.
Here is my best try in fixing this, but it doesn't work. How can I do instead?
\documentclass{scrartcl}
\usepackage{xifthen}
\makeatletter
\renewcommand{\scr@@makesinglelinecaption}[3]{%
\usekomafont{caption}{\strut\ignorespaces
#1{{\usekomafont{captionlabel}{#2\ifthenelse{\isempty{#3}}{}{\captionformat}}}}%
\ignorespaces #3\unskip}%
}
\makeatother
\begin{document}
\begin{figure}
\caption{Test}
\caption{}
\end{figure}
\end{document}