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.

  • 1
    Can you please create a minimum working example with emphasis on the minimal? Delete all the packages except what you need to draw the \Earth symbol, then add the other packages back in one at a time until you get the error. – darthbith May 13 '14 at 14:01
  • You also have a typo: end{equation} needs an `\` before it. – darthbith May 13 '14 at 14:02
  • Apart from the typo darthbith detected: Try \earth from the wasysym package – Christian Hupfer May 13 '14 at 14:03
  • 3
    Use amsmath package before mathabx. Works fine. – ferahfeza May 13 '14 at 14:05
  • @ ferahfeza: Why is it so? – mattiav27 May 13 '14 at 14:10
up vote 3 down vote accepted

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

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.