%%
%% The LaTeX Companion, 3ed
%%
%% Example 3-3-16 on page I-164 in "xfrac --- Customizable \protect \sfrac [hls-bf]{text}{fractions}".
%%
%% Copyright (C) 2022 Frank Mittelbach
%%
%% It may be distributed and/or modified under the conditions
%% of the LaTeX Project Public License, either version 1.3c
%% of this license or (at your option) any later version.
%%
%% See
https://www.latex-project.org/lppl.txt for details.
%%
\documentclass{tlc3exa}
\pagestyle{empty}
\setcounter{page}{6}
\setlength\textwidth{48.0pt}
\setlength\parindent{0pt}
%StartShownPreambleCommands
\usepackage{xfrac,lmodern}
%StopShownPreambleCommands
\begin{document}
\rmfamily \sfrac{1}{2} \itshape \sfrac{3}{4} \bfseries \sfrac{5}{6} \\
\sffamily \sfrac{7}{10} \upshape \sfrac{8}{15} \mdseries \sfrac{9}{23} \\
\ttfamily \sfrac{1}{25} \slshape \sfrac{1}{100} \bfseries \sfrac{1}{1000}
\end{document}