[Tex/LaTex] How to use Boondox calligraphic font in LaTeX without replacing \mathcal command

errorsfont-encodingsfontsformattingpackages

This is a follow-up question to a previous question I asked about how to use the Boondox calligraphic font alongside the standard \mathcal font. The solution involved getting the \mathalfa package running, which replaced the original font (produced by the \mathcal command) with the Boondox font. The second step was to create a separate command (e.g. \mathcalorig), which would be used to call upon the original, "standard" calligraphic font again.

My question now: Is it possible to achieve both fonts working alongside each other without outright replacing \mathcal? For instance, I would like for \mathcal to output the original "standard" calligraphic font, and give the boondox font (which I don't use nearly as often) its own command, e.g. \mathcalboondox. Then in summary we would have:

  • Typing \mathcal produces the regular behavior you expect, i.e. gives you the standard calligraphic style we're familiar with
  • Typing \mathcalboondox will give you the boondox-style font on the rare occasion you want to use that instead of regular \mathcal

Here's a picture describing what I'm looking for:

enter image description here

Is this possible to achieve? Thanks in advance for your help!

Best Answer

It's simpler to do by hand what mathalfa does:

\documentclass{article}

\DeclareFontFamily{U}{BOONDOX-calo}{\skewchar\font=45 }
\DeclareFontShape{U}{BOONDOX-calo}{m}{n}{
  <-> s*[1.05] BOONDOX-r-calo}{}
\DeclareFontShape{U}{BOONDOX-calo}{b}{n}{
  <-> s*[1.05] BOONDOX-b-calo}{}
\DeclareMathAlphabet{\mathcalboondox}{U}{BOONDOX-calo}{m}{n}
\SetMathAlphabet{\mathcalboondox}{bold}{U}{BOONDOX-calo}{b}{n}
\DeclareMathAlphabet{\mathbcalboondox}{U}{BOONDOX-calo}{b}{n}

\begin{document}
$\mathcal{ABC}$ $\mathcalboondox{ABC}$
\end{document}

enter image description here

But there's a different way, with mathalfa, which allows to call the alphabet as \mathscr:

\documentclass{article}
\usepackage[scr=boondoxo,scrscaled=1.05]{mathalfa}

\begin{document}
$\mathcal{ABC}$ $\mathscr{ABC}$
\end{document}