josephwright / siunitx

A comprehensive (SI) units package for LaTeX
LaTeX Project Public License v1.3c
350 stars 25 forks source link

Ranges starting at 1 with print-unity-mantissa=false leads to the 1 not printing #700

Closed l1ama closed 8 months ago

l1ama commented 8 months ago

Annoyingly, this is an installation-dependent issue, which only occurs on one computer I compile things with (windows 10, texstudio & miktex for both working and non-working installations). I've already tried updating all packages. Example code causing the issue:

\documentclass[12pt]{article}

\usepackage{siunitx}
\sisetup{print-unity-mantissa = false}

\begin{document}
    \SIrange{1}{3}{\milli\hertz} discrepancy (\SIrange{0.1}{0.2}{\percent})
\end{document}

Compiling this generates the attached pdf and log file, where the first 1 does not print. If I switch to print-unity-mantissa = true either globally or for that instance of SIrange, it does. In checking the manual I see now that \qtyrange is recommended over \SIrange, but it has the same issue (I assume it's just a different name for the same function).

scratch.log scratch.pdf

l1ama commented 8 months ago

I've found this which seems to be the same or a very similar issue, and can confirm it's not related to ranges in particular, it does the same (not printing the 1) with \qty{1}{\litre} as in that case.

josephwright commented 8 months ago

The issue isn't actually in the range code: it's that \num{1} isn't working properly here.

josephwright commented 8 months ago

Sorted - release later today