4

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.

4
  • There are known compatibility issues with the (very old) package mathabx. It redefines many commands for mathematical symbols. If you only need a handful of symbols from mathabx, 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, 2022 at 15:19
  • Sorry, how do i "import"?? In the 2nd link, it seemed that the "98" in\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) Feb 12, 2022 at 15:40
  • You are right, you need to pick the correct number for the desired symbol. Luckily, there is a reference for mathabx with lists and tables. See my answer.
    – marquinho
    Feb 12, 2022 at 15:46
  • Potential duplicate: Importing a single symbol from a different font Feb 12, 2022 at 20:14

1 Answer 1

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
3
  • 1
    Thank you so much, Marquinho!! I have been at it the whole day. It works fine now. I appreciate your kind help. Feb 12, 2022 at 15:48
  • 1
    @SphericalMoments You're very welcome! I remember my own frustration with this issue and with mathabx!
    – marquinho
    Feb 12, 2022 at 15:51
  • 1
    And 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, 2022 at 21:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .