How can you use the symbol \mathtt{A} and the Package \usepackage{MnSymbol}?

My code begin with




I get these warnings and errors

! LaTeX Error: Too many math alphabets used in version normal.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
l.656 \mathtt B
_{n,k}(P_1,\dots,P_m,\dots)=\mathfrak B_{n,k}[\a^{( P)}_{\Ph...
Your command was ignored.
  • 2
    Do you really need MnSymbol? It produces symbols with shapes clashing with Latin Modern fonts. And it's hungry with respect to math alphabets, as you discovered. – egreg Oct 16 '15 at 8:37
  • 1
    A workaround is to use \textnormal{\texttt{B}} instead of \mathtt[B}. Note that you allocate a math group (there are only 16 of them) for stmaryrd and shuffle. – egreg Oct 16 '15 at 8:44
  • Weird, I compiled using this preamble with no problem. – Francis Oct 16 '15 at 8:46
  • 2
    Unrelated to the problem, but there's no need to load amsmath or amssymb twice. – Ian Thompson Oct 16 '15 at 8:57

I can reproduce the issue with



where only the math font related packages have been kept.

One has to know that each \DeclareSymbolFont declaration uses up one of the available 16 math groups. The default setup allocates groups from 0 to 3, then amssymb allocates other two; four are used by MnSymbol, one by stmaryrd and one by shuffle. A total of twelve, so only three additional math alphabets can be used in the document.

Some \mathX command don't really use a new math alphabet, which is the case for \mathbb (it shares a math group with those defined by amssymb) but not of \mathfrak nor \mathbf and others. Math alphabets (loaded with \DeclareMathAlphabet) only allocate a math group at point of usage, so in the code above the first four instructions exhaust the available groups and \mathtt is not able to find a place for allocating a group.

You can avoid wasting math groups with various techniques. For instance, the shuffle package can be avoided by defining the symbols it provides in a different way:



$x\shuffle y\cshuffle z_{x\shuffle y\cshuffle z}$


and now \mathtt can be used. This doesn't guarantee that math groups will not be used up again. For the most rarely used commands of the set, you can define (slower) substitutes; for instance, here's the preamble code for not allocating a math group with \mathtt:

    \text{\normalfont\ttfamily #1}%
| improve this answer | |

It looks like you've got some redundant packages in there which are using up math family slots (of which there are only 16 total). (Note that amsart also loads the amsfonts package which uses up several more for \mathfrak, \mathbb, etc.).

I am not sure you really need the MnSymbol package. If I am not wrong it is enough to have the amssymb package.

I found an example on the internet:

\usepackage{amsmath, amssymb, amscd, MnSymbol,mathrsfs}
\DeclareMathAlphabet{\mathbbm}{U}{bbm}{m}{n}% from bbm.sty
\mathbf A
\mathcal A
\mathfrak A
\mathscr A
\mathsf A
\mathbb A
\mathbbm a

Let me know if it compiles.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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