Very late answer, but you could also locally set the mathcodes of the letters to the ones plain TeX defines. Then you load the Computer Modern Calligraphic fonts and redefine \mathcal
to locally switch to this family and use the “legacy” mathcodes.
This solution is superior to the other answer, because you obtain proper scaling of the calligraphic letters in sub/superscripts.
\documentclass{article}
\usepackage{unicode-math}
\newtoks\legacymathcodes\legacymathcodes={
\mathcode`A="7141 \mathcode`B="7142 \mathcode`C="7143
\mathcode`D="7144 \mathcode`E="7145 \mathcode`F="7146
\mathcode`G="7147 \mathcode`H="7148 \mathcode`I="7149
\mathcode`J="714A \mathcode`K="714B \mathcode`L="714C
\mathcode`M="714D \mathcode`N="714E \mathcode`O="714F
\mathcode`P="7150 \mathcode`Q="7151 \mathcode`R="7152
\mathcode`S="7153 \mathcode`T="7154 \mathcode`U="7155
\mathcode`V="7156 \mathcode`W="7157 \mathcode`X="7158
\mathcode`Y="7159 \mathcode`Z="715A
}
\font\tensy=cmsy10
\font\sevensy=cmsy7
\font\fivesy=cmsy5
\newfam\cmcalfam
\textfont\cmcalfam=\tensy
\scriptfont\cmcalfam=\sevensy
\scriptscriptfont\cmcalfam=\fivesy
\protected\def\mathcal#1{{\fam\cmcalfam
\the\legacymathcodes #1}}
\begin{document}
$\mathcal{DFIP}_{\mathcal{DFIP}_{\mathcal{DFIP}}}$
\end{document}
If you don't want to type all the mathcodes, e.g. in case you want to extend it to lowercase as well (which CM doesn't have), you could also set the mathcodes in a loop.
\documentclass{article}
\usepackage{unicode-math}
\font\tensy=cmsy10
\font\sevensy=cmsy7
\font\fivesy=cmsy5
\newfam\cmcalfam
\textfont\cmcalfam=\tensy
\scriptfont\cmcalfam=\sevensy
\scriptscriptfont\cmcalfam=\fivesy
\protected\def\mathcal#1{%
\begingroup
\fam\cmcalfam
\count0=`A
\loop\ifnum\count0<\numexpr`Z+1\relax
\mathcode\count0=\the\numexpr"7141 - `A + \count0\relax
\advance\count0 by 1
\repeat
#1%
\endgroup
}
\begin{document}
$\mathcal{DFIP}_{\mathcal{DFIP}_{\mathcal{DFIP}}}$
\end{document}
unicode-math
. So what do you mean by "unless"? --- Anyway, the notion that there's no way to do it is so silly I reject it. Even if I cannot just load it as a font, I could patchunicode-math
to leave\mathcal
alone or, as a last resort, I could typeset the alphabet in a box before loadingunicode-math
and then use the box. --- But I have to believe there are more elegant solutions than that.unicode-math
, the last example you get it from Latin Modern Math which is the closest you can get. – Khaled Hosny« Please note, that Khaled Hosny is one of the original developers ofunicode-math
. Saving the alphabet to a box might indeed be possible, but will for sure bring several downsides.unicode-math
interface by which the original font can be retrieved (perhaps there should be). But I would even be happy with a patch or 'hack' – one which is more elegant than using boxes. --- Indeed, storing those characters in boxes has downsides. I mention some in my answer below. --- Anyway, thanks for your help!\mathcal
boils down to\fam2
, at least 'out of the box'). That simply doesn't work once you switch to the Unicode mechanism, which doesn't use families at all.