10

I'm writing a report in French in which I want to display units with non-integer exponents:

\documentclass[10pt,letterpaper]{article}
\usepackage{siunitx}
\begin{document}
    \sisetup{locale=FR}
    Value of \SI{39.2}{\mega\pascal\metre\tothe{0.5}}.
\end{document}

In French commas are used as decimal separators. It works fine for the value of 39.2, but the comma does not follow in the exponent.

enter image description here

The same happens with the macro \raiseto. Any ideas how to get this right?

12

There's currently an oversight here in the code. For the present, use

\documentclass[10pt,letterpaper]{article}
\usepackage{siunitx}
\ExplSyntaxOn
\cs_set_protected:Npn \__siunitx_unit_format_power_aux: {
  \str_if_eq:VnTF \l__siunitx_per_mode_tl { repeat }
    { \__siunitx_unit_format_power_repeat: }
    { \__siunitx_unit_format_power_per: }
  \str_if_eq:VnF \l__siunitx_tmpa_tl { 1 }
    {
      \__siunitx_unit_format_power_brackets:
      \tl_put_right:Nx \l__siunitx_unit_current_tl
        {
          \exp_not:N \PrintSuperscript
            {
              \__siunitx_unit_format_power_aux:n
                { \exp_after:wN \__siunitx_unit_format_power:w \l__siunitx_tmpa_tl . . \q_stop }
            }
        }
    }
}
\cs_new:Npn \__siunitx_unit_format_power:w  #1 . #2 . #3 \q_stop
  {
    \exp_not:n {#1}
    \tl_if_blank:nF {#2}
      {
        \exp_not:V \l__siunitx_output_decimal_tl
        \exp_not:n {#2}
      }
  }
\ExplSyntaxOff
\begin{document}
    \sisetup{locale=FR}
    Value of \SI{39.2}{\mega\pascal\metre\tothe{0.5}}.
\end{document}
|improve this answer|||||
  • That does the trick... thanks! – SimonLR Feb 17 at 17:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.