2

I am using this to collect some of my thoughts on the use of exponent-to-prefix because I know the developer is around here. My question could be titled "Will those three things be fixed in a future version of siunitx?" I could submit this as a bug report, but I imagine not all of this may be fixed, so the answer might include why. I am also looking for a short-term workaround to the final example.

\documentclass{article}
\usepackage{siunitx}
\begin{document}
    % infinite loop:
    %\SIlist[exponent-to-prefix=true]{1e3}{m}

    % should maybe print a warning, not an error:
    % \SIlist[scientific-notation=true,exponent-to-prefix=true]{10000; 20000}{\m}

    % this works as expected:
    \SIlist[scientific-notation=engineering,exponent-to-prefix=true]{10000; 20000}{\m}

    % does not work as expected. **Edit** I would love to see "10.000 and 20.000 km" here:
    \SIlist[scientific-notation=engineering,exponent-to-prefix=true,list-units=single]{10000; 20000}{\m}

    % this is closer, but still does not work:
    \SIlist[scientific-notation=fixed,fixed-exponent=3,exponent-to-prefix=true,list-units=single]{10000; 20000}{\m}
\end{document}

The first line causes an infinite loop that should not happen so easily, I would think.

The second line throws an error, but it should really be a warning in my opinion because the manual clearly states

When the exponent-to-prefix option is set true, the package will attempt to convert any exponents in quantities into unit prefixes, and will attach these to the first unit given. This process is only possible if the exponent is one for which a prefix is available, and retains the number of significant figures in the input.

So in my eyes, a warning would be enough.

Finally, I wonder how (with a patch or a future version), exponent-to-prefix can be combined with list-units=single successfully.

  • 1
    You can ask Joseph Wright in TeX.SX chat. He is there 'sometimes' ;-) – user31729 Mar 29 '16 at 18:54
  • All the examples for exponent-to-prefix use a “macro form” for the unit. – egreg Sep 6 '19 at 10:07
1

Partial response for the first point only: using \meter instead of m in unit seems to fix the infinite loop (but I cannot explain why).

\SIlist[exponent-to-prefix=true]{1e3;2e3}{\metre}
% Produces "1 km and 2 km"
| improve this answer | |

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.