Can I prevent a package from redefining a command?
1,056
before loading the package do
\let\origbar\bar
\let\origdot\dot
\usepackage{...}
\let\bar\origbar
\let\dot\origdot
Note that in some cases you may need to postpone the redoing until after \begin{document}
One might wonder why you are using runes in a documnt with math?
Related videos on Youtube
Author by
Saibot
Updated on December 24, 2020Comments

Saibot almost 3 years
I like to use runes and letters from other nonstandard alphabets as mathematical symbols. However, now the
allrunes
package is interfering with my other mathematical typesetting. Take this minimal example:\documentclass{article} \usepackage{allrunes} \begin{document} $\bar{x}$ \end{document}
I get these error messages:
LaTeX Warning: Command \bar invalid in math mode on input line 6. ! LaTeX Error: Command \bar unavailable in encoding OT1.
I think that the problem lies in
allrunes.sty
, which redefines the\bar
command:\newcommand{\DeclareRuneSeparators}[1]{% [..] \DeclareTextSymbol{\bar}{#1}{33} % ! [..] } % end of newcommand{\DeclareRuneSeparators}
Is there a way to prevent
allrunes
from redefining\bar
, so that I can still use it as the usual math symbol? Or any other way of recovering the functionality of\bar
?The exact same happens not just for
\bar
, but also for\dot
.
egreg almost 10 yearsBeware that
allrunes
also does some other redefinitions that are quite disputable. In particular it redefines\bfseries
and this can lead to severe problems.


Saibot almost 10 yearsThanks, that works perfectly! Runes are useful as an additional source of mathematical symbols without any predefined meaning or connotation, and they are kind of entertaining as well.

Saibot almost 10 yearsI don't have enough reputation (yet) for an upvote.

daleif almost 10 years@TobiasFritz, I do not think that is a good idea. Inventing additional mathematical symbols often ends up giving headaches to those trying to typeset what ever the mathematician have invented. Did you have a look in the symbols list instead?

Saibot almost 10 yearsthat's a good point which I'll have to keep in mind. In the present case, we use them only for some simple examples, so it shouldn't be harmful, but I'll reconsider it.

Ott Toomet almost 4 yearsI am explaining how to transform images represented in matrix form, and runes make beautiful lineart symbols that are easy to be put into matrices.