Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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."

share|improve this question
    
Welcome to TeX.sx! A tip: If you indent lines by 4 spaces or enclose words in backticks `, they'll be marked as code, as can be seen in my edit. You can also highlight the code and click the "code" button (with "{}" on it). –  bloodworks Jan 17 '13 at 22:05
    
Search-and-Replace should take care of the “a lot of files” problem. For the latter part of your question: \newcommand can only detect command from the class and from packages that are loaded (at that point). For checking “all” packages, the texdef script may help. –  Qrrbrbirlbel Jan 17 '13 at 22:11
    
On the latter one: Psmith, a bot in the TeX.SX chat, helps you without the need to dance around Perl. –  Qrrbrbirlbel Jan 17 '13 at 22:28

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.