Consider the following MWE where the code comes from here and is then modified a bit:
\documentclass{article}
\usepackage{siunitx}
\ExplSyntaxOn
\NewDocumentCommand\SIexpr{O{,}mm}{
\SIext:nnn{#1}{#2}{#3}
}
\cs_new_protected:Npn \SIext:nnn#1#2#3{
\seq_set_split:Nnn \l_SIext_input_seq{#1}{#2}
\seq_pop_left:NN \l_SIext_input_seq \l_SIext_first_tl
\seq_clear:N \l_SIext_output_seq
\seq_put_right:Nx \l_SIext_output_seq{
\fp_compare:nTF{\l_SIext_first_tl > 0}
{\num{\l_SIext_first_tl}}
{-\num{\tl_tail:V \l_SIext_first_tl}}
}
\seq_map_inline:Nn \l_SIext_input_seq{
\seq_put_right:Nx \l_SIext_output_seq{
\fp_compare:nTF{##1 > 0}
{+\num{##1}}
{-\num{\tl_tail:n{##1}}}
}
}
\SI[
parse-numbers = false,
quotient-mode = fraction,
input-product = *,
output-product = \cdot
]{
\sisetup{parse-numbers}
\left(\seq_use:Nn \l_SIext_output_seq{}\right)
}{#3}
}
\ExplSyntaxOff
\begin{document}
\SIexpr{5, -2*1}{\s}
\end{document}
Whan I compile via pdflatex using my up-to-date TeX Live 2021 distribuion, I get the following warning and error:
Package siunitx Warning: Option "quotient-mode" has been removed in this
(siunitx) release.
! LaTeX3 Error: The key 'siunitx/input-product' is unknown and is being
(LaTeX3) ignored.
For immediate help type H <return>.
...
l.41 \SIexpr{5, -2*1}{\s}
How do I fix the code in order for it to compile properly once again?
input-productand in combination withparse-numbers = falseit looks a bit odd there. In any case if you want products, you will have to check the documentation for\numproductand\qtyproduct. Also I don't think that you can use *, you will have to use x for the product. – Ulrike Fischer May 26 '21 at 07:32siunitx. – egreg May 26 '21 at 08:45\def\horse{45}. Then I cannot use\SIexpr{200, -2*\horse}, but I have to put2*\horseinside an\fpeval{}. Can this be changed so that I don't have to use\fpeval{}? – Svend Tveskæg May 26 '21 at 14:25110(= 200 - 2*45) in this case. I have this issue in quite a few documents so it would help me alot if this can be "fixed". (I think the problem is thatinput-productisn't suppoered anymore but I'm not sure.) – Svend Tveskæg May 26 '21 at 18:40