cdominik / cdlatex

Fast input methods to enter LaTeX environments and math with GNU Emacs
230 stars 47 forks source link

The \rm command is deprecated. In math mode use \mathrm instead, outside \rmfamily #46

Closed Sinthoras7 closed 2 years ago

Sinthoras7 commented 2 years ago

When using the feature, which inserts a "\rm", when typing '_' or '^' twice, (which worked fine), I got an compiling error stating "Class scrartcl Error: undefined old font command '\rm'.".

Further research yielded the result, that the commands "\rm", "\bf" and "\it" should never be used in Latex2ε and instead their newer versions "\rmfamily", "\bfseries" and "\itshape" should be used. The KomaScript-Classes even enforce this behaviour and thus lead to this error. However, "\rmfamily" does not work in math mode, while "\mathrm" does. Because of this, I suggest, changing the "\rm" to a "\mathrm". This should be fine in most cases and be the prefered solution.

Thank you!

cdominik commented 2 years ago

Hi,

you are of course right. I just don't like the long command and extra braces required, but this is the correct solution. I made the change.

Sinthoras7 commented 2 years ago

That was quick. Thank you!