By analyzing my document I noticed that the less or equal symbol leq is printed in undesiderate way becuase the mathabx package overwrites other mathematical packages. I need to extract only astronomical symbols from mathabx package (see following screenshot taken from the package documentation): astrosymbols_from_mathabx

Here is my MWE where I noticed the different symbols (slant equal sign instead of horizontal) produced by leq if the mathabx package is active:

\usepackage{mathabx} % enable astronomy symbols




Can you show how to extract only astronomical symbols from mathabx isuch as to avoid to overwrite other commands?


3 Answers 3


In mathabx.dcl we find

\DeclareMathSymbol{\Sun}           {0}{mathb}{"40}
\DeclareMathSymbol{\Mercury}       {0}{mathb}{"41}
\DeclareMathSymbol{\Venus}         {0}{mathb}{"42}
\DeclareMathSymbol{\Earth}         {0}{mathb}{"43}
\DeclareMathSymbol{\Mars}          {0}{mathb}{"44}
\DeclareMathSymbol{\Jupiter}       {0}{mathb}{"45}
\DeclareMathSymbol{\Saturn}        {0}{mathb}{"46}
\DeclareMathSymbol{\Uranus}        {0}{mathb}{"47}
\DeclareMathSymbol{\Neptune}       {0}{mathb}{"48}
\DeclareMathSymbol{\Pluto}         {0}{mathb}{"49}
\DeclareMathSymbol{\varEarth}      {0}{mathb}{"4A}
\DeclareMathSymbol{\leftmoon}      {0}{mathb}{"4B}
\DeclareMathSymbol{\rightmoon}     {0}{mathb}{"4C}
\DeclareMathSymbol{\fullmoon}      {0}{mathb}{"4D}
\DeclareMathSymbol{\newmoon}       {0}{mathb}{"4E}

OK, now we want to see what mathb refers to, which we find in mathabx.sty

      <5> <6> <7> <8> <9> <10> gen * mathb
      <10.95> mathb10 <12> <14.4> <17.28> <20.74> <24.88> mathb12

Now it's just a matter of refactoring to just use the font as a text one.


  <-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






enter image description here

  • Hi @egreg, can you show how to modify your code to use the symbols in math mode? I want to use $\Sun$ instead of \Sun. With the present code, if I type $\Sun$ I get the undesiderate symbol @.
    – g_don
    Nov 20, 2022 at 19:01
  • 1
    @Giuseppe Change into \newcommand{\mathbsymbol}[1]{\text{\usefont{U}{mathb}{m}{n}\symbol{#1}}} and, of course, load amsmath
    – egreg
    Nov 20, 2022 at 21:06

As you mentioned, mathabx redefines all math symbols in an undesirable way. You can: a) change the mathabx package with another that does not redefine math symbols and does contain astronomical symbols like wasysym or marvosym or starfont packages b) keeping mathabxpackage but employ lualatex or xelatex and loading after mathabx package unicode-math which will redefine back the math symbols.

  • Hi @Miltos P., thank for your answer. I 'd like to keep mathabx astronomical symbols. Can you kindly show an example how to extract a single command (e.g. \Sun) and avoid to load the entire package?
    – g_don
    Nov 18, 2022 at 21:38
  • 1
    No you can't do that (from what I know). You can use xelatex or lualatex instead of pdflatex in this case and then load after the mathabx the unicode-math. Do you want help with that? Have you ever used lualatex or xelatex?
    – miltos
    Nov 18, 2022 at 21:47

If you can use LuaLaTeX or XeLaTeX, you can load most of these symbols from Unicode. Here’s a template that defines the majority of them with the same names, but in text mode.


\newfontfamily\varearthfont{Libertinus Serif}[Scale=MatchLowercase]
\newfontfamily\astrofont{Everson Mono}[Scale=MatchUppercase] % Actually contains U+1F728.

\newcommand\Earth{{\astrofont\symbol{"1F728}}} % Could instead substitute \oplus.
\newcommand\varEarth{{\varearthfont\symbol{"2641}}} % Wukipeia thinks this is for a fictitious planet “Proserpina.”

The planets: \Mercury\Venus\Earth\varEarth\Mars\Jupiter\Saturn\Uranus\Neptune\Pluto

Other Celestial bodies: \Sun\leftmoon\rightmoon

Everson Mono/Libertinus Serif sample

You must log in to answer this question.

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