Undocumented incompatibility between changes and siunitx?
changes
uses internally the ulem
package, and this can't handle complicated macros. You normally should hide them in a \mbox
:
\documentclass[]{article}
\usepackage{changes}
\usepackage{siunitx}
\begin{document}
This is a new length of \SI{8}{\meter};
This is a new length of \deleted{\mbox{\SI{8}{\meter}}}.
This is a new length of \replaced{\mbox{\SI{8}{\meter}}}{\mbox{\SI{3}{\meter}}}.
\end{document}
You can provisionally redefine \SI
to use \mbox
around it.
\documentclass[]{article}
\usepackage{changes}
\usepackage{siunitx}
\ExplSyntaxOn
\RenewDocumentCommand \SI { o m o m } {
\mbox{
\bool_set_false:N \l__siunitx_font_set_bool
\IfNoValueTF {#1}
{ \__siunitx_combined:nnnn { } {#2} {#3} {#4} }
{
\keys_set:nn { siunitx } {#1}
\__siunitx_combined:nnnn {#1} {#2} {#3} {#4}
}
}
}
\ExplSyntaxOff
\begin{document}
This is a new length of \SI{8}{\meter};
This is a new length of \deleted{\SI{8}{\meter}}.
This is a new length of \replaced{\SI{8}{\meter}}{\SI{3}{\meter}}.
\end{document}
I'd prefer a changes
method that avoids striking out (color would be sufficient).
\documentclass[]{article}
\usepackage{changes}
\usepackage{siunitx}
\setdeletedmarkup{\textcolor{red}{#1}}
\begin{document}
This is a new length of \SI{8}{\meter};
This is a new length of \deleted{\SI{8}{\meter}}.
This is a new length of \replaced{\SI{8}{\meter}}{\SI{3}{\meter}}.
\end{document}