3

I want the create a compound adjective, e.g.,

\documentclass{article}
\usepackage{siunitx}

\begin{document}
The $50-\si{\hertz}$ signal is obtained via...
\end{document}

The output is horrible, though

enter image description here

My goal is to get something like

enter image description here

4
  • 2
    Off-topic: \si and \SI are deprecated. Use \unit and \qty instead.
    – Mico
    Commented Aug 25, 2023 at 19:29
  • @Mico \qty breaks when using along with the physics package. Commented Aug 25, 2023 at 20:28
  • 3
    Please see the query Silencing 'siunitx' and 'physics' package \qty warning and, in particular, this answer for a workaround.
    – Mico
    Commented Aug 25, 2023 at 21:16
  • First time here, otherwise this would be a comment (which it should be) rather than an answer. The issue here is nothing to do with your use of siunitx. You have a hyphen in a maths environment, which outputs a minus sign. Do what you'd do anywhere else $50\text{-}...$. Aside 1: There is no need to use inline maths here. Aside 2: I don't like using hyphens with (SI) units (against SI for one thing), but some publishers allow/insist on it when use is adjectival. If there is an insistence on adjectival hyphen (and siunitx use) here, then 'The 50-Hz signal...' (or 'The 50-\si{\hertz} signal...')
    – PDL
    Commented Aug 26, 2023 at 11:51

1 Answer 1

3

You need to set a non-default value for the quantity-product formatting option. (The default value is \,, i.e., "thinspace".)

enter image description here

\documentclass{article}
\usepackage{siunitx}
\begin{document}
The \qty[quantity-product={-\kern-1pt}]{50}{\hertz} signal is obtained via \dots
\end{document}
1
  • 1
    ‘Do not do this’: the requirements for units are clear, the symbols are not affected by grammatical rules
    – Joseph Wright
    Commented Aug 25, 2023 at 22:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .