I need the \blackdiamond symbol (not \bigLozenge) in some equations; so I used the mathabx package. But, this altered other symbols such \rightsquigarrow. How can I use \blackdiamond without altering other symbols? Please help. Thank you.
Asked
Active
Viewed 324 times
4
marquinho
- 1,721
1 Answers
5
There are known compatibility issues with the (very old) package mathabx. It redefines aggressively a huge number of mathematical symbols, changing their appearance.
Therefore, it is advisable not to load mathabx at all, if you can help it. It is possible to import individual symbols from mathabx.
To do so, one can look up the desired symbol in the mathabx command and symbol lists. Then, one can import those symbols following the approach detailed here.
Assuming you only need the \blackdiamond (table mathb, number 0C) and assuming that you want it to be a binary operator (the way it is defined in mathabx), here's the code for your preamble:
\DeclareFontFamily{U}{mathb}{}
\DeclareFontShape{U}{mathb}{m}{n}{<-5.5> mathb5 <5.5-6.5> mathb6
<6.5-7.5> mathb7 <7.5-8.5> mathb8 <8.5-9.5> mathb9 <9.5-11> mathb10
<11-> mathb12}{}
\DeclareSymbolFont{mathb}{U}{mathb}{m}{n}
\DeclareFontSubstitution{U}{mathb}{m}{n}
\DeclareMathSymbol{\blackdiamond}{\mathbin}{mathb}{"0C} % \mathbin for a binary operator
marquinho
- 1,721
-
1Thank you so much, Marquinho!! I have been at it the whole day. It works fine now. I appreciate your kind help. – Spherical Moments Feb 12 '22 at 15:48
-
1@SphericalMoments You're very welcome! I remember my own frustration with this issue and with
mathabx! – marquinho Feb 12 '22 at 15:51 -
1And in order to avoid wasting a math group for just one symbol, you could say
\DeclareRobustCommand{\blackdiamond}{\mathbin{\text{\usefont{U}{mathb}{m}{n}\symbol{"0C}}}}removing\DeclareSymbolfont{mathb}{U}{mathb}{m}{n}– egreg Feb 12 '22 at 21:06
mathabx. It redefines many commands for mathematical symbols. If you only need a handful of symbols frommathabx, it is advisable not to load it at all. You can import the individual symbols following the approach detailed here, here and here. – marquinho Feb 12 '22 at 15:19\DeclareMathSymbol{\smalltriangleup} {2}{mathb}{"98}decides the symbol; what number should I indicate for blackdiamond? Do I need to copy everything there? (I am asking because I dont want to change other symbols) – Spherical Moments Feb 12 '22 at 15:40