How can I use \SI from siunitx inside \replaced from changes?
The problem here is actually an interaction with the \sout
command from the ulem
package. Essentially, there is a clash over the insertion of a \penalty
between the number and the unit: ulem
alters how this expects to work and that doesn't agree with the box/grouping in siunitx
. I've not traced it all back to a minimal example of the low-level code, but that probably wouldn't help in any case (at least without quite a bit of effort). What you can do is simply disable the insertion of a penalty. There isn't an interface for this (one of the few things not in the options for siunitx
!) so at the moment a low-level redefinition is required
\documentclass{article}
\usepackage{siunitx}
\usepackage{changes}
\ExplSyntaxOn
\cs_set_eq:NN \__siunitx_unit_output_number_sep:
\__siunitx_unit_output_number_sep_aux:
\ExplSyntaxOff
\begin{document}
\replaced{\SI{1}{\volt}}{\SI{2}{\volt}}
\end{document}