[Tex/LaTex] “Too many math alphabets” with Beamer and DeclareSymbolFont

amsmathbeamerfonts

The following is a near-minimal example of my problem:

\documentclass[dvipsnames]{beamer}

\usepackage{stmaryrd}
\usepackage{MnSymbol}

\DeclareSymbolFont{bbsymbol}{U}{bbold}{m}{n}
\DeclareMathSymbol{\bbsemi}{\mathbin}{bbsymbol}{"3B}

% Import some stuff from mathabx.sty -- because mathabx.sty incompatible with
% amsmath package.
\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}

\begin{document}

\begin{frame}
    $\mathbf{0} \mathsf{hello}$
\end{frame}

\end{document}

I would like to be able to use stmaryrd and MnSymbol in the same doc. I would also like some stuff from mathabx, but because of incompatibility with amsmath (which is imported automatically by MnSymbol), I use DeclareSymbolFont to import it, as described in 1. Moreover I would also like to define a blackboard semicolon operator, and so I also use DeclareSymbolFont to introduce bbsymbol. Finally I want mathbf and mathsf.

Unfortunately this seems to run out of space for math alphabets in Beamer, but not (for example) if I build a regular article.

Is there a solution that meets all my requirements, for Beamer? (It seems that deleting any one of the imported or defined fonts fixes the problem, but then I don't have all my requirements satisfied.)

Best Answer

In the end I added the following after the \DeclareFontFamily business above:

% Use these in preference to stmaryrd (to avoid math alphabet limits).
\DeclareMathSymbol{\ldbrack}{3}{matha}{"76}
\DeclareMathSymbol{\rdbrack}{3}{matha}{"77}

So it looks like I pulled in the characters I needed from mathabx rather than stmaryrd in the end.

I'm not sure if this counts as an answer to my original question, but I've posted it here in case it's useful anyway.