# How to make calligraphic numbers available with unicode-math?

I use xits-math.otf with unicode-math with XeLaTeX.

It defines calligraphic upper case letters, but I need calligraphic lower case letters and especially numbers as well.

I tried this:

\documentclass{minimal}
\usepackage[math-style=TeX, bold-style=TeX]{unicode-math}
\usepackage{fontspec}

\setmathfont[StylisticSet=0]{xits-math.otf}
\setmathfont[range={\mathcal,\mathbfcal},StylisticSet=1]{xits-math.otf}

\newfontfamily\mathc[Path=/usr/share/texlive/texmf-dist/fonts/type1/public/mathabx-type1/]{mathc10.pfb}

\begin{document}
$\mathcal{mathcal ABC 123}$ \\
$\mathbfcal{mathbfcal ABC 123}$ \\
\mathc{mathc10.pbf abc ABC 123 !@\$\%\&} \end{document}  This gives me the uppercase \mathcal and \mathbfcal letters, but as you can see, the lowercase letters and numbers, are just the standard italic and upright symbols, respectively. In that example, I made an extra font definition using fontspec to get access to the calligraphic font used with mathabx. With that, I can access the symbols, but not by using \mathcal, which is quite inconvenient, but the most inconvenient with this workaround, is that it doesn't work in math mode. I have to use \text{\mathc{3}} to get a calligraphic '3', which is isn't really an option. Also, no bold calligraphic symbols, which I don't really need, but it feels like something's missing. A while ago, I asked here how to get the "mathc10" font while using MnSymbol. I don't use MnSymbol anymore, but I tried the solution anyway: \documentclass{minimal} \usepackage[math-style=TeX, bold-style=TeX]{unicode-math} \usepackage{fontspec} \setmathfont[StylisticSet=0]{xits-math.otf} \setmathfont[range={\mathcal,\mathbfcal},StylisticSet=1]{xits-math.otf} \DeclareFontFamily{OT1}{mathc}{} \DeclareFontShape{OT1}{mathc}{m}{n}{ <-> mathc10 }{} \DeclareMathAlphabet\mathcal{OT1}{mathc}{m}{n} \newfontfamily\mathc[Path=/usr/share/texlive/texmf-dist/fonts/type1/public/mathabx-type1/]{mathc10.pfb} \begin{document}$\mathcal{mathcal ABC 123}$\\$\mathbfcal{mathbfcal ABC 123}$\\ \mathc{mathc10.pbf abc ABC 123 !@\$\%\&}
\end{document}


This kinda creates a new problem, while solving another: I have now access to calligraphic numbers with \mathcal - although no bold version - but now the letters are gone.

I'm thinking I might need a different OTF font for the \mathcal and \mathbfcal ranges, but I don't know which one, and I don't know if that's actually the best solution.

Again, what I need is:

• calligraphic letters
• calligraphic numbers
• accessing them with \mathcal

Nice to have:

• calligraphic bold version of letters and numbers
• what are calligraphic/script digits needed for? when it was being decided what would be put in the unicode block of math alphanumerics, script digits weren't even considered, since no one knew of any established use for them in math or technical environments. if a published example can be cited, this decision could be reconsidered. – barbara beeton Jun 13 '14 at 13:57
• @barbarabeeton — I thought I had an example of my own that I collected from a mathematician, but it must be buried in an email somewhere… they thought it quite natural to use separate script and calligraphic letters, but you know how mathematicians can be :) – Will Robertson Jun 13 '14 at 14:53
• @barbarabeeton my Math professor uses it in his lecture on probability. He's now making that into a book. Calligraphic leters are used for sets of events inside a probability realm, calligraphic numbers are used for sets if certain classes of those events. – polemon Jun 13 '14 at 17:10
• @polemon -- it would be helpful if your professor could provide a page of his (draft) book on which the meaning of the calligraphic digits is defined, preferably a page which also shows other numerals in a math context that shouldn't be confused with the ones for which a calligraphic form is desired. the address given in my profile can be used for questions or other relevant communications. thanks. – barbara beeton Jun 13 '14 at 18:04
• @barbarabeeton OK, I'll try to help, but I'd have to ask for permission first, etc. I don't know exactly how he's gonna go about publishing it, so there might be some sort of copyright issues, etc. In any event, I'll ask. – polemon Jun 13 '14 at 18:13

You don't need to load the mathc10 font with fontspec; however it doesn't have a boldface companion, as already said elsewhere.

\documentclass{article}
\usepackage{amsmath}
\usepackage[math-style=TeX, bold-style=TeX]{unicode-math}

\setmathfont[]{xits-math.otf}
\setmathfont[range={\mathcal,\mathbfcal},StylisticSet=1]{xits-math.otf}

\DeclareFontFamily{OT1}{mathc}{}
\DeclareFontShape{OT1}{mathc}{m}{n}{ <-> mathc10 }{}
\DeclareRobustCommand\xmcal[1]{\text{\usefont{OT1}{mathc}{m}{n}#1}}

\begin{document}
$\mathcal{mathcal ABC 123}$

$\mathbfcal{mathbfcal ABC 123}$ \\

$\xmcal{ABC abc 123}$

\end{document}


• It seems this rather "hackish" solution is the best it can get. For me, this isn't optimal, but the best alternative anyway. – polemon Jun 22 '14 at 23:46

Use \mathscr instead:

\documentclass{article}
\usepackage[math-style=TeX, bold-style=TeX]{unicode-math}
\setmathfont{XITS Math}
\setmathfont[range={\mathscr,\mathbfscr,\mathcal,\mathbfcal}]{Cambria Math}
\def\Lcs#1{\texttt{\textbackslash#1}}

\begin{document}\noindent
\Lcs{mathscr}: $\mathscr{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$\\
\Lcs{mathscr}: $\mathscr{abcdefghijklmnopqrstuvwxyz}$\\
\Lcs{mathbfscr}: $\mathbfscr{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$\\
\Lcs{mathbfscr}: $\mathbfscr{abcdefghijklmnopqrstuvwxyz}$

\noindent
\Lcs{mathcal}: $\mathcal{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$\\
\Lcs{mathcal}: $\mathcal{abcdefghijklmnopqrstuvwxyz}$\\
\Lcs{mathbfcal}: $\mathbfcal{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$\\
\Lcs{mathbfcal}: $\mathbfcal{abcdefghijklmnopqrstuvwxyz}$

\end{document}


• I know of that, but the problem is, it doesn't give me the calligraphic numbers. – polemon Jun 16 '14 at 1:16
• Sorry but I fail to see how this answers the question. (And as far as I can see, the question has not been edited so it isn't just that the question changed after the answer was posted.) This may be a good answer to a different question, but it doesn't seem to address this one at all. – cfr Oct 19 '14 at 22:57