Convert the macro `\si` in the new version 3 of siunitx

siunitx

In the manual, unless I am mistaken, it says to replace \si by \unit.

But I have this error:

Package siunitx Error: Found prefix part with no unit.

How can I make this document compatible with the new version 3 of siunitx?

\documentclass[aspectratio=1610,10pt,french]{beamer}

\usepackage[french]{babel} 
\usepackage[output-decimal-marker={,}]{siunitx}  

    
\begin{document}
\begin{frame}
%  \sisetup{color = blue}

  \begin{tabular}{l l l}
   kilo $=1000$ & noté \unit{\kilo} &\rule[2mm]{0pt}{5mm} Exemples:\ \unit{\kilo\metre}; \unit{\kilo\gram};% \\
%   hecto $=100$ & \repete{noté} \si{\hecto} &\rule[2mm]{0pt}{5mm}\repete{Exemple:}\ \  \si{\hecto\meter}; \si{\hecto\gram}; \si{\hecto\liter}\\
%   deca $=10$ & \repete{noté} \si{\deca}& \rule[2mm]{0pt}{5mm}\repete{Exemple:}\ \  \si{\deca\meter}; \si{\deca\gram}; \si{\deca\liter}\\
%      déci $=0.1=\dfrac{1}{10}$ & \repete{noté} \si{\deci} & \rule[2mm]{0pt}{5mm}\repete{Exemple:}\ \ \si{\deci\meter}; \si{\deci\gram}; \si{\deci\liter} \\
%   centi $=0.01=\dfrac{1}{100}$ & \repete{noté} \si{\centi} & \rule[2mm]{0pt}{5mm}\repete{Exemple:}\ \ \si{\centi\meter}; \si{\centi\gram}; \si{\centi\liter}\\
%    milli $=0.001=\dfrac{1}{1000}$ & \repete{noté} \si{\milli} & \rule[2mm]{0pt}{5mm}\repete{Exemple:}\ \ \si{\milli\meter}; \si{\milli\gram}; \si{\milli\liter}
  \end{tabular}

\end{frame}
\end{document}

Best Answer

First off, you can use \si also with siunitx version 3, but it's deprecated and is present for back compatibility.

Second: a prefix must be followed by a unit; it wasn't enforced in version 2, now it is.

With a little stretch, you can define a \siprefix command:

\documentclass{article}
\usepackage{siunitx}

\NewDocumentCommand{\siprefix}{m}{%
  \unit{#1\nonexistentunitjustforprefixes}%
}
\DeclareSIUnit{\nonexistentunitjustforprefixes}{\relax}

\begin{document}

\siprefix{\kilo}

\end{document}

You could actually do \unit{k}, but this would defy the purpose of the package.