The following MWE
\documentclass{scrartcl}\usepackage{caption}\begin{document}Test\end{document}gives the error
Package caption Warning: Unknown document class (or package),(caption) standard defaults will be used.See the caption package documentation for explanation.
The same happens for scrbook. Standard classes likearticle work well.
The documentation of thecaption package mentions that it does support Koma classes. So the above might be a bug.
I am interested in any workaround.
- you should report to
caption's maintainer, but one reasonable fix would be to update the documentation to say koma classes are no longer supported. (I do not know how much work would be involved in supporting the current versions, but it is probably not trivial.)cfr– cfr2025-11-05 04:45:41 +00:00Commented22 hours ago - 1As I know the
captionpackage is no more maintained, but KOMA-Script still try to maintain the compatibility (that's what is said in the preface to the version 3.46).jlab– jlab2025-11-05 06:55:18 +00:00Commented20 hours ago - It is only a warning. Does anything actually break? Is some caption not as you want it?Ulrike Fischer– Ulrike Fischer2025-11-05 07:17:53 +00:00Commented20 hours ago
- @UlrikeFischer I was afraid that the warning was a sign that something might go wrong in the future. Your answer shows that it should not be the case. I am thus happy to ignore the warning.PHL– PHL2025-11-06 02:13:47 +00:00Commented1 hour ago
2 Answers2
In previous times the caption package tried to ensure that it stays compatible with the KOMA-classes. It detected the class and then adapted some of its commands. If KOMA changed something caption tried to follow.
But some months ago the maintainer of caption announced that he will no longer maintain the caption package. Therefore the KOMA maintainer took over and nowreacts to the loading of caption in order to then establish compatibility itself.
So the caption package should continue to work fine with KOMA, if there is a problem you can report it to the KOMA issue tracker (I found one a few days ago:https://sourceforge.net/p/koma-script/tickets/98).
One side effect of the policy change is that caption warns you that KOMA has changed and is now "unknown" (which is true) but as long as you do not get wrong output or errors, you can ignore that.
The warning is generated by the lines 51-55
\caption@ifdocumentclass{unknown}% {\caption@WarningNoLine{% Unknown document class (or package),\MessageBreak standard defaults will be used}}% {}of the filecaption.sty.
You can preventcaption from trying to detect the class and force the standard defaults with
\def\caption@documentclass{standard}%before\usepackage{caption}.
Example:
\documentclass{scrartcl}\makeatletter\def\caption@documentclass{standard}%\makeatother\usepackage{caption}\begin{document}Test\end{document}You could try
\def\caption@documentclass{koma}%or
\def\scr@caption{}to forcecaption using the settings for KOMA-Script classes (caption detects the KOMA-Script classes by testing if\scr@caption is defined). This will load the filecaption-koma.sto and raises the error
caption-koma.sto:90: LaTeX Error: Command \@setcapindent undefined.showing that currentcaption support for KOMA-Script classes is obsolete.
You mustlog in to answer this question.
Explore related questions
See similar questions with these tags.
