# [OS X TeX] \newcommand problem with sn-jnl.cls

Manfred Braun manfred.braun at uni-due.de
Mon Sep 19 02:55:55 EDT 2022

Dear Roussanka,

It is a general problem that publishers insist on their own style files, while authors want to use their personal macros. It depends very much on the publisher what they allow to change.

To solve your special problem just write
\renewcommand{\R}{\mathbb{R}}
\newcommand{\R}{\mathbb{R}}
This will overwrite the previous definition.

Sometimes, it may be advisable to keep the original meaning before redefining it. This can be done by
\let\Rorig=\R
\renewcommand\R{…}
Then the “old” \R is still available under the name \Rorig.

The command \R is apparently introduced by the package “program” included in the publisher's cls file, see the README at
https://ctan.org/pkg/program?lang=en <https://ctan.org/pkg/program?lang=en>
If you don’t need program documentation in your article you could comment out the
\usepackage{program}%
from the sn-jnl.cls file and get rid of the predefined \R. I, personally, use the \R command just in your sense.

Best regards,
Manfred

> On 19. Sep 2022, at 03:50, Roussanka Loukanova <rl.stpuu at gmail.com> wrote:
>
> Dear All,
>
> I have a question that is off the list, but I hope to get it resolved
>
> I have to use Springer's style for journals  <sn-jnl.cls> from the
> Springer package:
> sn-article-template
> https://www.springernature.com/gp/authors/campaigns/latex-author-support#c17590862
>
> I have my own style file of defined \newcommand{...}{...} and
> \DeclareMathOperator{...}{...}.
>
> Typesetting (by pdflatex) .tex files that use Springer's cluster
> \documentclass[sn-mathphys]{sn-jnl}
> produces errors adding my own definitions in .tex files, by:
>
> I get the error even if I add a single definition
> \newcommand{\R}{\mathbb{R}}
> in the preamble of Springer's  template file  <sn-article.tex>.
> I get the following error:
>
> ==
> ERROR: LaTeX Error: Command \R already defined.
>
> --- TeX said ---
>               Or name \end... illegal, see p.192 of the manual.
> ==
>
> I would appreciate help.
>
> Best Regards,
> Roussanka
> ----------- Please Consult the Following Before Posting -----------
> TeX FAQ: https://www.tug.org/mactex/faq/index.html
> List Reminders and Etiquette: https://sites.esm.psu.edu/~gray/TeX/
> List Archives: http://dir.gmane.org/gmane.comp.tex.macosx
>                https://email.esm.psu.edu/pipermail/macosx-tex/
> TeX on Mac OS X Website: https://www.tug.org/mactex/index.html
> List Info: https://email.esm.psu.edu/mailman/listinfo/macosx-tex

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://email.esm.psu.edu/pipermail/macosx-tex/attachments/20220919/09828f4a/attachment.htm>