You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
About 20 years ago Harald Harders copied some code from KOMA-Script, namely \ifnumber, \test@number, \gobble@till@next. Inside the definitions babelbib still uses \scr@next. Maybe it would be a good idea to change the prefix \scr@ to a babelbib specific prefix.
I've already renamed KOMA-Script's \gobble@till@next years ago. So this shouldn't be a problem, but e.g., package volumes does use the same macro name, because Frank Küster also copied code from KOMA-Script.
Until today the definition of \test@number was a problem, because if babelbib is loaded before scrbase there would be an error because of the already defined command. However, I have changed this today, using another macro name.
One problem with \ifnumber is: The LaTeX Team recommend to use \if… only for TeX like syntax: \if… … \else …\fi, but not for commands with arguments. They recommend to use either \If… or \If…TF or \…if…. Because of this, I've renamed the original \ifnumber in scrbase to \Ifnumber. The old \ifnumber currently outputs a warning, that it is deprecated. Currently there is a special treatment to avoid this warning, if babelbib is loaded. But maybe it would be a good idea to also rename it, e.g., to \btx@ifnumerical as already shown as margin note in the manual and already found in the index (but not yet defined).
A second problem with \ifnumber in babelbib is: The old code still used in babelbib does not work correctly with empty argument. Try:
\documentclass[english]{article}
\usepackage{babel}
\usepackage{babelbib}
\begin{document}
1234 is \ifnumber{1234}{}{not} a number.
ABCD is \ifnumber{ABCD}{}{not} a number.
The empty string is \ifnumber{}{}{not} a number.% results in an error\end{document}
The improved definition of scrbase does work correctly:
\documentclass{article}
\usepackage{scrbase}
\begin{document}
1234 is \ifnumber{1234}{}{not} a number.
ABCD is \ifnumber{ABCD}{}{not} a number.
The empty string is \ifnumber{}{}{not} a number.
\end{document}
The text was updated successfully, but these errors were encountered:
Hi @komascript
thanks a lot for all the suggestions. I have tried following your advice and renamed \src@next to \btx@next and rename \ifnumber to \btxifnumber. I opted against \btx@ifnumerical since it is used in the test document and might be useful for normal documents.
What I haven't look into is the scrbase definition of ifnumber, maybe I copy it over.
About 20 years ago Harald Harders copied some code from KOMA-Script, namely
\ifnumber
,\test@number
,\gobble@till@next
. Inside the definitionsbabelbib
still uses\scr@next
. Maybe it would be a good idea to change the prefix\scr@
to ababelbib
specific prefix.I've already renamed KOMA-Script's
\gobble@till@next
years ago. So this shouldn't be a problem, but e.g., packagevolumes
does use the same macro name, because Frank Küster also copied code from KOMA-Script.Until today the definition of
\test@number
was a problem, because ifbabelbib
is loaded beforescrbase
there would be an error because of the already defined command. However, I have changed this today, using another macro name.One problem with
\ifnumber
is: The LaTeX Team recommend to use\if…
only for TeX like syntax:\if… … \else …\fi
, but not for commands with arguments. They recommend to use either\If…
or\If…TF
or\…if…
. Because of this, I've renamed the original\ifnumber
inscrbase
to\Ifnumber
. The old\ifnumber
currently outputs a warning, that it is deprecated. Currently there is a special treatment to avoid this warning, ifbabelbib
is loaded. But maybe it would be a good idea to also rename it, e.g., to\btx@ifnumerical
as already shown as margin note in the manual and already found in the index (but not yet defined).A second problem with
\ifnumber
inbabelbib
is: The old code still used inbabelbib
does not work correctly with empty argument. Try:The improved definition of
scrbase
does work correctly:The text was updated successfully, but these errors were encountered: