7

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!

  • May be a \let\oldmathcal\mathcal before \usepackage[..]{mathalfa} and then define whatever you want with \oldmathcal or \mathcal? – Manuel May 28 '15 at 23:41
12

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}
3

You can define a new math alphabet and load a BOONDOX-scr package with \mathscr and \\mathbscr commands in the place of \mathcal and mathbcal, transpose from the original BOONDOX-cal package. Here is the small code for the new package:

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{boondox-scr}[2015/05/29 v1 U/BOONDOX-scr]
\RequirePackage{xkeyval}%
\define@key{BOONDOX-scr.sty}{scaled}[1.0]{%
\expandafter\def\csname BOONDOX-scr@scale\endcsname {#1}}%
\ExecuteOptionsX<BOONDOX-scr.sty>{scaled}%
\ProcessOptionsX<BOONDOX-scr.sty>\relax%
\DeclareMathAlphabet{\mathscr}{U}{BOONDOX-cal}{m}{n}
\SetMathAlphabet{\mathscr}{bold}{U}{BOONDOX-cal}{b}{n}
\DeclareMathAlphabet{\mathbscr} {U}{BOONDOX-cal}{b}{n}
\endinput


        \documentclass[12pt]{article}
        \usepackage[utf8]{inputenc}
        \usepackage{boondox-scr}
        \pagestyle{empty}

        \begin{document}%
        \textbf{%
        Boondox :
        }%

        \[ \begin{array}[t]{c@{\quad}c@{\quad}c}
            \verb+ \mathcal + & \verb+ \mathscr + & \verb+ \mathbscr +\\[6pt]
            \mathcal{EMTS} & \mathscr{LnS} & \mathbscr{LnS}
            \end{array} \]%

        \end{document}

Result:

enter image description hereCode incorporated in the preamble:

        \documentclass[12pt]{article}
        \usepackage[utf8]{inputenc}
         \DeclareMathAlphabet{\mathscr}{U}{BOONDOX-cal}{m}{n}
         \SetMathAlphabet{\mathscr}{bold}{U}{BOONDOX-cal}{b}{n}
         \DeclareMathAlphabet{\mathbscr} {U}{BOONDOX-cal}{b}{n}
        \pagestyle{empty}

        \begin{document}%
        \textbf{%
        Boondox :
        }%

        \[ \begin{array}[t]{c@{\quad}c@{\quad}c}
            \verb+ \mathcal + & \verb+ \mathscr + & \verb+ \mathbscr +\\[6pt]
            \mathcal{EMTS} & \mathscr{LnS} & \mathbscr{LnS}
            \end{array} \]%

        \end{document} 
  • Hi Bernard, thanks for your answer. Where does the top code go, in the preamble? I'm getting a lot of errors, starting with "Undefined control sequence \define". – Mathemanic May 29 '15 at 1:19
  • @EthanAlvaree: Sorry, I posted an old version of the files. I've updated the post. So,, the topcode can be either saved as a boondox-scr file, in your local TeXMF root (whatever the name of the local root, more precisely in \localroottex\latex\boondox), then refresh the FNDB if you're under MiKTeX, or the equivalent under TeX Live, or leave it in the same direcrory as your main file, or incorporate the code in your preamble, between \makeatletter and \makeatother. – Bernard May 29 '15 at 6:51
  • Hi Bernard, I'm trying to include the top code in the preamble (between \makeatletter and \makeatother as you said). I'm getting the error File 'boondox-scr.sty' not found. \pagestyle. Here's a link to your sample code I've entered in an online LaTeX editor/compiler: sharelatex.com/project/5569db658576bc3369cdace0 – Mathemanic May 30 '15 at 18:39
  • @EthanAlvaree: I think you misunderstood what has to be done: I posted an example of a boondox-src.sty, to be put in the same directory as the main file or in a places searched by latex, or to be incorporated in the main file preamble. I upd – Bernard May 30 '15 at 22:11

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.