0

I try to use the siunitx package in TeXstudio, as far as I know \si is the old version and \qty is the new version.

I tried following:

\documentclass{article}
\usepackage{siunitx}
\begin{document}
\qty[mode = text]{1.23}{J.mol^{-1}.K^{-1}} \\
\qty{.23e7}{\candela} \\
\qty[per-mode = symbol]{1.99}{\per\kilogram} \\
\qty[per-mode = fraction]{1,345}{\coulomb\per\mole}
\end{document}

The \qty is included in the auto completion, but the PDF is not created correctly. enter image description here

I am using Ubuntu 20.04, I tried the code above in Overleaf and there it is working totally fine.

Can you help me find the problem?

Thanks in advance!

cgnieder
  • 66,645
Basti
  • 23
  • 6
    It's not your editor that's important, it's your TeX system (or rather your version of siunitx): add \listfiles to your input and report the siunitx version from the File list in the .log. – Joseph Wright Mar 16 '22 at 16:53
  • 8
    Ubuntu is known to be behind on their LaTeX updates, so you probably only have siunitx version 2, \qty is from version 3. Both v2 and v3 supports \SI{...}{...} though (in v3 \SI = \qty – daleif Mar 16 '22 at 16:55
  • Okay, yes it seems like I have only version 2. Is there a way to update the version? – Basti Mar 17 '22 at 09:25
  • If and how it is possible to update your TeX system depends on how it was installed. If you installed TeX live from the Ubuntu package sources via apt/apt-get you essentially have a frozen system that cannot be updated. In that case you may want to stick to the old siunitx v2 interface. You can, however, remove the apt TeX live and install a "vanilla" TeX live from TUG.org that can be updated (see https://tex.stackexchange.com/q/1092/35864) - but it still needs to be upgraded once a year (https://tex.stackexchange.com/q/107017/35864). – moewe Mar 21 '22 at 05:59

0 Answers0