[Tex/LaTex] Siunitx and cancel package

cancelsiunitx

I want to symbolically cancel out units using the siunitx package. To do so I tried the cancel package as in the following minimal example:

\documentclass{article}

\usepackage{amsmath}
\usepackage[per=frac]{siunitx}
\usepackage{cancel}

\begin{document}
\begin{align*}
   \frac{\SI{7}{\m}}{\SI{3}{\m}} =  \frac{\SI{7}{\cancel \m}}{\SI{3}{\cancel \m}}
\end{align*}
\end{document}

But this gives me the following output, i.e. when using \cancel the font of the unit changes which is not desired. Any idea how to fix this?

output

Edit: I tried @percusse's solution which works very well. But if I also add the option expproduct=cdot to the package options, the problem reappears.

Best Answer

You are using an old type of option to siunitx. If I fix the option everything is shown as expected. It also warns you to use the version 2 type inputs.

\documentclass{article}

\usepackage{amsmath}
\usepackage[per-mode=fraction]{siunitx}
\usepackage{cancel}

\begin{document}
\begin{align*}
   \frac{\SI{7}{\m}}{\SI{3}{\m}} =  \frac{\SI{7}{\cancel\m}}{\SI{3}{\cancel\m}}
\end{align*}
\end{document}

enter image description here