Package scrbase Warning: Usage of deprecated command `\if…'.
In KOMA-Script LaTeX commands like \ifattoclist
, \ifdimen
, \ifdvioutput
, \ifintnumber
, \ifiscount
, \ifiscounter
, \ifisdimen
, \ifisdimension
, \ifisdimexpr
, \ifisglue
, \ifisglueexpr
, \ifisinteger
, \ifisnumexpr
, \ifisskip
, \ifnotundefined
, \ifnumber
, \ifnumbered
, \ifpdfoutput
, \ifpsoutput
, \ifstr
, \ifstrstart
, \ifthispageodd
, \iftocfeature
, \ifundefinedorrelax
, \ifunnumbered
could be found partly for almost 20 years,. Then, with the appearance of iftex
, the urgent recommendation came from The LaTeX Project Team to start only TeX-style branches \if... ... \fi
with \if...
and for LaTeX commands with argument, such as \IfFileExists
, to use a command name with \If...
, i.e. capitalized "I
" at the beginning. It was recommended to carry this through also retroactively for already existing commands. Therefore in KOMA-Script 3.28 all these commands were renamed. To make the transition a little easier, most of the old commands were temporarily defined as well. However, they are only defined if they are not already defined when loading the corresponding KOMA-Script package or KOMA-Script class. In addition, they then currently produce a warning of the type:
Package scrbase Warning: Usage of deprecated command `\ifstr'.
(scrbase) The command has been renamed because of a
(scrbase) recommendation of The LaTeX Project Team.
(scrbase) Please replace `\ifstr' by `\Ifstr' in input line 4711
The easiest way to get rid of this warning is to follow the recommendation and replace the corresponding statement.
If this is not possible because the statement is contained in a package written by someone else, check if there is already an update for that package that solves this problem. If this is not the case either, the author of the corresponding package should be asked for a solution to the problem.
In case code compatible with both an older version of KOMA-Script and KOMA-Script 3.28 or later is to be created, it is a good idea to define the corresponding new command itself via \providecommand
based on the affected deprecated command after loading the KOMA-Script class or the KOMA-Script package that normally provides the command, for example:
\documentclass{article}
\usepackage{scrbase}
\providecommand*{\Ifstr}{\ifstr}
\begin{document}
Cucumbers are at \KOMAScriptVersion{} \Ifstr{cucumbers}{tomatoes}{}{no }tomatoes.
\end{document}
On the other hand, under no circumstances should you continue to use the deprecated version itself, because while:
\newif\ifstr
\documentclass{article}
\usepackage{scrbase}
\providecommand*{\Ifstr}{\ifstr}
\begin{document}
Cucumbers are at \KOMAScriptVersion{} \Ifstr{cucumbers}{tomatoes}{}{no }tomatoes.
\end{document}
works fine with current KOMA-Script, this is not the case with
\newif\ifstr
\documentclass{article}
\usepackage{scrbase}
\providecommand*{\ifstr}{\Ifstr}% CAUTION: DO NOT DO!
\begin{document}
Cucumbers are at \KOMAScriptVersion{}
\ifstr% ATTENTION: DO NOT MAKE!
{cucumbers}{tomatoes}{}{no }tomatoes.
\end{document}
is not the case. With obsolete KOMA-Script, of course, both last shown examples would result in an error message, because of already defined \ifstr
. But the \newif
in front of \documentclass
is only an example here. A corresponding declaration could also be found in the LaTeX kernel or a class or package in the future. With new KOMA-Script this would not be a problem (in contrast to older versions).
By the way, in a future version of KOMA-Script the warning should become an error message before in the long run the commands are not defined at all. So simply ignoring it would not be a good idea.
Translated with www.DeepL.com/Translator (free version)