6

I am in the process of replacing the caption package with KOMA-Script in a long document. Where caption allows me to suppress the figure-number at the start of any caption by using \caption*{text}, I see nothing comparable in the KOMA-Script documentation. Can someone enlighten me?

Edit: I would like to suppress the whole "Figure x.y:" marker before the actual caption text, just as caption* does.

  • But \caption* not only suppresses the number; it also suppresses the label ("Figure" or "Table"). – Gonzalo Medina Aug 6 '12 at 19:40
  • @GonzaloMedina: That's true, and that's what I would like. I'll edit to make that clear. – brannerchinese Aug 6 '12 at 19:42
  • Ah, then I'll un-delete my answer ;-) – Gonzalo Medina Aug 6 '12 at 19:44
8

As far as I could see in the documentation, there's no build-in equivalent to \caption* in the KOMA classes, but KOMA gives you the tools to easily define such a command:

\documentclass{scrartcl}

\makeatletter
\newcommand\WLcaption[1]{%
  \renewcommand*{\figureformat}{}
  \renewcommand*{\tableformat}{}
  \renewcommand*{\captionformat}{}
  \addtocounter{\@captype}{-1}
  \caption{#1}}
\makeatother

\begin{document}

\begin{figure}
\centering
\rule{3cm}{2cm}
\WLcaption{A test caption without label for a figure}
\end{figure}

\begin{figure}
\centering
\rule{3cm}{2cm}
\caption{A test caption with label for a figure}
\end{figure}

\begin{table}
\centering
\rule{3cm}{2cm}
\WLcaption{A test caption without label for a table}
\end{table}

\begin{table}
\centering
\rule{3cm}{2cm}
\caption{A test caption with label for a table}
\end{table}

\end{document}

enter image description here

1

Assuming that you mean to use a KOMAScript class by "replacing 'caption' with koma" you could simply redefine \figureformat :

\documentclass{scrbook}

\begin{document}

\renewcommand*{\captionformat}{}   
\renewcommand*{\figureformat}{}

\begin{figure}
\caption{x}
\end{figure}

\end{document}

will strip the whole label.

  • Thanks. Some authors prefer captions alone to appear with figures, without figure numbers. Go figure. – brannerchinese Aug 6 '12 at 19:27
  • But this still leaves the separator (: by default.) – Gonzalo Medina Aug 6 '12 at 23:45
  • yeah i see i removed it accidentally – bloodworks Aug 7 '12 at 7:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.