9

In my preamble I have a newcommand definition using the following syntax:

\newcommand{\RN}{\bcR^{\bcN}}

This command lets me print R^N in the sort of boldface I like. I've used this command without any problems for a couple of years. But I recently started using biblatex, and it seems there is a command name conflict. More specifically, \RN is a command that biblatex uses in connection with its display for Roman Numerals. So when I try to compile, I get an error. What is the simplest way for me to resolve this problem? I realize that I could replace my \RN command syntax in the preamble, for instance I could change to:

\newcommand{\ReN}{\bcR^{\bcN}}

But wouldn't this require me to change \RN to \ReN everywhere it appears in all my source code files? I could make the changes using my text editor, but I have a lot of files, so it would take a long time to fix things using this approach. Is there anything simpler I can do?

Also, this raises a more basic question: Suppose the user wants to define a new command, and wants to check ahead of time to make sure that the syntax for their new command is not already in use by any popular packages. Is there a utility that exists that will allow the user to type in their contemplated syntax, and will check all existing (popular) packages, and then come back with either the response "yes, you can use that syntax without fear of conflict", or, "No, you can't use that syntax without a potential conflict, and here is a list of packages that already use your contemplated command syntax."

1 Answers1

7

That's an unfortunate combination, it happened also to me.

You might try this temporary workaround for old files

\usepackage[<options>]{biblatex}

%\newcommand{\RN}{\bcR^{\bcN}} % doesn't work any more
\let\biblatexRN\RN
\protected\def\RN{\ifmmode\bcR^{\bcN}\else\expandafter\biblatexRN\fi}

but use a new command name for you "ℝ" from now on.

Note that this doesn't (heavily) depend on the present definition of \RN given by biblatex, therefore it should cause no harm even if the command is redefined by that package, as long as the redefinition is performed after having loaded biblatex.

egreg
  • 1,121,712