What do I need to do to define a \mathscr
which can handle both upper and lower case letters and a \mathcal
which can handle both upper and lower case, with the latter staying as close to the default \mathcal
as possible?
A simple approach with a single \usepackage
line along with some options supplied would be desirable. Every other solution I run into which involves a \newcommand
, makeatletter
, \newenvironment
, \setmathfont
, etc., has failed me.
Below, boondox
was as close as I could get to the existing \mathcal
. Note that my definition for scr
did not support lowercase, for some reason.
XeLaTeX/PdfLaTeX make no difference here.
I've gone through a number of posts related to this topic, with none just working for me. I may have an issue with not being able to install font packages correctly? This is mysterious.
\documentclass{article}
\usepackage{mathrsfs}
\usepackage[scr=rsfs,cal=boondox]{mathalfa}
\begin{document}
$$\mathscr{abcdefghijklmnopqrstuvwxyz}$$
$$\mathscr{ABCDEFGHIJKLMNOPQRST}$$
$$\mathcal{abcdefghijklmnopqrstuvwxyz}$$
$$\mathcal{ABCDEFGHIJKLMNOPQRST}$$
\end{document}
UPDATE: This may just be an issue with the rsfs
font. Replacing my usepackage
line above with
\usepackage[scr=esstix,cal=boondox]{mathalfa}
produces results for all four lines. I prefer the rsfs
fonts to esstix
and prefer whatever the default \mathcal
font is to boondox
. But if no one has another solution, this may just need to be what I go with.
Best Answer
The
unicode-math
package supports OpenType math fonts, all of which have lowercase script letters (as well as bold).By default, the package loads the same font as
\mathcal
and\mathscr
, but you can override this with\setmathfont[range={cal,bfcal}, Scale=MatchUppercase]{...}
or\setmathfont[range={scr,bfscr}, Scale=MatchUppercase]{...}
.A few other OpenType math fonts come with separate
\mathcal
and\mathscr
alphabets, including XITS Math and Asana Math. You can, however, mix and match however you like. You could, for example, addor
to use the script or calligraphic alphabets above in another document.
There are a handful of legacy NFSS math script fonts that come in lowercase. For example,
stix2-mathscr
does, butstix2-mathcal
does not. Themathalfa
package ought to be able to load the lowercase alphabet if it exists; you should not need to load bothmathalfa
and a package such asmathrsfs
.