2

I have an up-to-date MiKTeX 2.9 installation on Windows 10, and recently I came across a weird behavior of siunitx where inter-unit-product doesn't affect the output as shown below.

A couple of days ago, it was working but now it doesn't. So, what might be the reason?

P.S. The log file can be found here.

enter image description here

\documentclass{exam}
\usepackage{mathtools}
\usepackage{unicode-math}
\usepackage{siunitx}

\sisetup{
    per-mode=symbol,
    per-mode=repeated-symbol,
    inter-unit-product = \ensuremath{{}\cdot{}}
}

\begin{document}
    \SI{4}{\left[\newton\m\s\per\radian\right]}
\end{document}
7
  • 3
    You've stuck random stuff inside the unit: it will force literal mode ... – Joseph Wright Nov 4 '19 at 21:52
  • Just out of curiosity: Why do you surround \newton\m\s\per\radian with \left[ and \right]? Without those fences, the output of \SI is just fine. – Mico Nov 4 '19 at 21:52
  • 1
    Side comment: The unit should never be put in square brackets. – Matthias Nov 4 '19 at 21:52
  • 1
    @Mico I am experimenting, and seemingly I messed it up. – Diaa Nov 4 '19 at 21:57
  • 1
    @Diaa No, because some people prefer not to use the unit macro.s You can forbid-literal-units if you wish – Joseph Wright Nov 4 '19 at 21:58
4

If, for some unfathomable reason, you simply must encase scientific units in square brackets, you shouldn't do it as

\si{\left[\newton\m\s\per\radian\right]}

Instead, do it as follows (in math mode, naturally):

\left[\si{\newton\m\s\per\radian}\right]

That said, I would strongly recommend against encasing scientific units in square brackets.

7
  • 2
    Not only you, but rather the BIPM. ;-) – egreg Nov 5 '19 at 0:05
  • May I know how to have control over the space surrounding the inter-product dot? – Diaa Dec 7 '19 at 17:17
  • @Diaa - "Control over the space" is a rather broad objective. The option inter-unit-product = \ensuremath{{}\cdot{}} makes LaTeX insert a thinspace on either side of of \cdot, while inter-unit-product = \ensuremath{{\cdot}} instructs LaTeX to insert no whitespace at all. – Mico Dec 7 '19 at 17:45
  • Thanks for the help. I rather found the space quite wide, which made me want to reduce it a bit without removing it at all. – Diaa Dec 7 '19 at 19:20
  • @dias - My mind-reading skills are, sadly, rubbish. As a result, if a person asks me something but isn't clear about the objective, chances are nil that I will guess that objective correctly. :-( To get LaTeX to insert half a thinspace around \cdot, give inter-unit-product = \ensuremath{\mkern1.5mu\cdot\mkern1.5mu} a try. (Can you guess that 1thinspace=3mu?) – Mico Dec 7 '19 at 19:51

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.