Skip to content

Misleading error message when "figurewithin" is used without the newfloat package

In package caption, version 2020-01-22 the misleading error message Undefined control sequence. \begin{document} occurs in the following setup (using figurewithin or tablewithin):

\documentclass{book}
%
\usepackage{caption}
%\usepackage{newfloat}
\usepackage{floatrow}
\captionsetup[figure]{figurewithin=chapter}
\begin{document}
hello world!
\end{document}

Furthermore, LaTeX writes the following text to the pdf output: floatnewfloat@undefined.

When using package newfloat (see line 4), it works just fine.