4

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.

cabohah's user avatar
cabohah
24k3 gold badges13 silver badges32 bronze badges
asked23 hours ago
PHL's user avatar
4
  • you should report tocaption'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.)Commented22 hours ago
  • 1
    As I know thecaption package 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).Commented20 hours ago
  • It is only a warning. Does anything actually break? Is some caption not as you want it?Commented20 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.Commented1 hour ago

2 Answers2

8

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.

answered18 hours ago
Ulrike Fischer's user avatar
3

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.

answered13 hours ago
jlab's user avatar

You mustlog in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.