11

I'm interested in using the standard \cup, i.e. plain \cup and the one given by importing the mathabx \cup mathabx \cup in the same document.

Does anyone know how to do that?

Marius
  • 547
  • I'd advise against doing this. The symbols are too similar. It would be difficult to read if you had both with different meanings. – Seamus Jan 31 '11 at 16:24
  • 1
    I disagree. In algebraic topology you need a symbol for union and something called the cup product. Traditionally they are denoted by almost exactly the same product but it is clear from the context whether you're talking about union or cup product. So for sake of keeping with the tradition I think it is a good idea to have e.g. plain \cup for union and the mathabx \cup for cup product. – Marius Jan 31 '11 at 16:28
  • 7
    I think that \smile looks better for a cup product, and is different enough from \cup that the two shouldn't get confused. – John Palmieri Jan 31 '11 at 17:24
  • 7
    @John: just be careful that \smile is of type \mathrel whereas \cup is of type \mathbin, so, to get correct spacing, you should use something like \newcommand{\cupproduct}{\mathbin{\smile}}. – Philippe Goutet Jan 31 '11 at 22:53
  • @John Palmieri's/Goutet, thanks! \smile is what worked for me, and it's simple, in that the \cup conflict is completely circumvented rather than resolved. – Karthik C Oct 24 '13 at 04:42

2 Answers2

16

Unlike @Herbert's solution, this solution does not change any math font. It just add an \abxcup we defined.

Some of the code is copied from mathabx.sty:

\documentclass{article}
\DeclareFontFamily{U}{matha}{\hyphenchar\font45}
\DeclareFontShape{U}{matha}{m}{n}{
      <5> <6> <7> <8> <9> <10> gen * matha
      <10.95> matha10 <12> <14.4> <17.28> <20.74> <24.88> matha12
      }{}
\DeclareSymbolFont{matha}{U}{matha}{m}{n}
\DeclareFontSubstitution{U}{matha}{m}{n}
\DeclareMathSymbol{\abxcup}{\mathbin}{matha}{'131}
\begin{document}
$A\cup B \abxcup C$
\end{document}

And this code showed how to get the glyph slot:

\documentclass{article}    
\usepackage{fonttable}
\begin{document}
\fonttable{matha10}
\end{document}
Leo Liu
  • 77,365
  • For those who want to do this with different symbols, note that you can also peruse the mathb10 and mathx10 font tables, and that you get the codes for \DeclareMathSymbol from the first row and first column of these tables (i.e., it's not the tiny number next to the symbol in the table). Don't forget to copy the correct code from mathabx.sty if you are using the b or x tables. – Ana Borges Feb 08 '23 at 17:04
9
\documentclass{article}
\usepackage[T1]{fontenc}
\let\ltxcup\cup
\usepackage{mathabx}
\begin{document}

$\ltxcup \cup$

\end{document}
  • I tried this, but it continues to use the symbol from the second font instead of the first. Does anyone have an idea what I'm doing wrong? – SPK.z Aug 31 '16 at 13:42