7

I'm using the siunitx package to problems in physics, but to express the speed units in the style \sfrac, they are too small, how could slightly increase the size?

\documentclass[12pt]{article}
\usepackage{amsmath, amssymb,amsfonts,latexsym,cancel,stmaryrd} %Soporte math símbolos-fonts.
\usepackage{siunitx, xfrac}
\usepackage{fourier}
\begin{document}
   Mi coche viaja a 
   $75\si[per-mode=fraction,fraction-function = \sfrac]{\kilo\metre\per\hour}$, 
   durante $3\si{\hour}$.
\end{document}

enter image description here

1
  • 6
    Unrelated, but you should use \SI[...]{75}{\kilo\metre\per\hour} instead of 75\si[...]{\kilo\metre\per\hour} to get the spacing right. Dec 30, 2014 at 15:45

1 Answer 1

9

The xfrac package permits to adjust the settings for \sfrac both in text and in math mode.

In math mode, the scaling of numerator and denominator is done with (the default is 0.7):

\DeclareCollectionInstance{plainmath}{xfrac}{mathdefault}{math}
{
scale-factor = 0.9
}
\UseCollection{xfrac}{plainmath}

So, the following MWE should give the desired result (I've used \SI instead of \si for better spacing):

\documentclass[12pt]{article}
\usepackage{amsmath, amssymb,amsfonts,latexsym,cancel,stmaryrd} %Soporte math símbolos-fonts.
\usepackage{siunitx, xfrac}
\usepackage{fourier}

\DeclareCollectionInstance{plainmath}{xfrac}{mathdefault}{math}
{
scale-factor = 0.9
}
\UseCollection{xfrac}{plainmath}

\sisetup{per-mode=fraction,fraction-function=\sfrac}

\begin{document}
   Mi coche viaja a
   $\SI{75}{\kilo\metre\per\hour}$,
   durante $\SI{3}{\hour}$.
\end{document} 

Output:

output

3
  • 2
    is it just me or is the spacing between the fraction and 75 a bit small?
    – daleif
    Dec 30, 2014 at 16:58
  • 5
    @daleif IMHO, it is just you :-) Dec 30, 2014 at 17:06
  • 2
    It just seems smaller than in \SI{3}{\hour}
    – daleif
    Dec 30, 2014 at 17:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .