[Tex/LaTex] conflict between mathabx and other packages

incompatibility

I need to write the symbol of the earth, which is found in the package mathabx. When I compile my script I get the following error:

! LaTeX Error: Command \iint already defined.
               Or name \end... illegal, see p.192 of the manual.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.505 ...d{\iint}{\DOTSI\protect\MultiIntegral{2}}.

It looks like a conflict between different packages.

Here is a sample of my latex script, with the packages I am using:

\documentclass[11pt,a4paper]{article}

\usepackage[pdfencoding=auto,psdextra]{hyperref}

\usepackage{mathabx}

\usepackage{amsmath}


\begin{document}
  \begin{equation}
    U_{\Earth}
  \end{equation}
\end{document}

I cannot understand what is wrong.

Best Answer

As egreg suggested, see Importing a Single Symbol From a Different Font for importing a single character from another font. To get \Earth, I did the following. If you unccoment these two lines in the MWE, \usepackage{fonttable} and \fonttable{mathb10}, you will get a font table printed out it from which it can be ascertained that \Earth is glyph "43 (hexadecimal). That allowed me to invoke in the preamble, \DeclareMathSymbol{\Earth}{3}{mathb}{"43} to import just that symbol. One may have to do a little trial and error in the process... originally I searched the matha font series and did not find \Earth, so by trial and error, I tried the mathb series and found the glyph. All the \DeclareFontShape stuff I just copied from Alan Munn's answer, substituting mathb for matha.

\documentclass[11pt,a4paper]{article}

\usepackage[pdfencoding=auto,psdextra]{hyperref}

%\usepackage{mathabx}

\usepackage{amsmath}

% Setup the mathb font (from mathabx.sty)
\DeclareFontFamily{U}{mathb}{\hyphenchar\font45}
\DeclareFontShape{U}{mathb}{m}{n}{
      <5> <6> <7> <8> <9> <10> gen * mathb
      <10.95> mathb10 <12> <14.4> <17.28> <20.74> <24.88> mathb12
      }{}
\DeclareSymbolFont{mathb}{U}{mathb}{m}{n}

% Define a subset character from that font (from mathabx.dcl)
% to completely replace the \subset character, you can replace
% \varsubset with \subset

\DeclareMathSymbol{\Earth}{3}{mathb}{"43}
%\usepackage{fonttable}
\begin{document}
%\fonttable{mathb10}
  \begin{equation}
    U_{\Earth}
  \end{equation}
\end{document}

enter image description here

Related Question