# Using 'xfrac' with 'mathrsfs'

I'm attempting to move from the nicefrac package to xfrac. The following source compiles, but with a warning:

\RequirePackage{fix-cm}
\documentclass{article}
\usepackage{xfrac}
\usepackage{mathrsfs}
\begin{document}
$\sfrac{1}{2}$
\end{document}


LaTeX Font Warning: Font shape 'U/rsfs/m/n' in size <3.49998> not available

It appears as though xfrac attempts to load all current math alphabets in its typeset size, even if they are not used in the fraction. Is there a variant of rsfs that supports fractional sizes? Or a way to prevent xfrac from loading it unless it is needed?

Basically, I'd like to suppress this warning unless LaTeX is actually typesetting a glyph from rsfs at a fractional size. Is this possible?

Fixed font sizes of rsfs font in NFSS scheme is declared in ursfs.fd. It contains

\ProvidesFile{ursfs.fd}[1998/03/24 rsfs font definition file (jk)]
\DeclareFontFamily{U}{rsfs}{\skewchar\font127 }
\DeclareFontShape{U}{rsfs}{m}{n}{%
<5> <6> rsfs5
<7> rsfs7
<8> <9> <10> <10.95> <12> <14.4> <17.28> <20.74> <24.88> rsfs10
}{}


Now you can modify it for continuous font sizes. You can just put the code in preamble:

\RequirePackage{fix-cm}
\documentclass{article}
\usepackage{xfrac}
\usepackage{mathrsfs}
\DeclareFontFamily{U}{rsfs}{\skewchar\font127 }
\DeclareFontShape{U}{rsfs}{m}{n}{%
<-6> rsfs5
<6-8> rsfs7
<8-> rsfs10
}{}
\begin{document}
$\sfrac{1}{2}$
\end{document}

• Hah, you barely beat me to it! I just discovered this by digging into fix-cm's source. I was, however, missing the \skewchar\font127. Is there any reason not to define this in terms of continuous font sizes? Or is this just something that wasn't possible long ago and has simply propagated through today? – Matt B. Feb 9 '11 at 19:03
• Now we are using Type1 fonts. They are scalable vector font. However, there are only bitmap fonts produced by MetaFont years ago, scaling is not preferred for performance reason. – Leo Liu Feb 9 '11 at 19:45