4

This example

\documentclass{article}
\usepackage{siunitx}
\begin{document}
... dimensions of at least \SI{0.5}{[a.u.]}.
\end{document}

produces the following result:

enter image description here

How can I have the dot with a.u.?

a.u. stands for arbitrary units. I am looking for a general case where one needs a dot in the units.

  • Possible duplicate of tex.stackexchange.com/questions/230129/…? – Sebastiano Jan 17 '18 at 9:53
  • 1
    This question might well be a duplicate of some other, but I wouldn't say it is a duplicate of this particular linked question. – gusbrs Jan 17 '18 at 10:28
  • 4
    Please, DON'T write units inside brackets. Units should be never typeset within brackets. Brackets are used around quantities to denote the unit of a quantity, e.g., [L] = m, or [v] = m/s. – Massimo Ortolano Jan 17 '18 at 10:37
7

siunitx has the unit \astronomicalunit defined (supposing that's what you want with "a.u."), I'd go with that, even though it is not rendered as you initially imagined. siunitx complies with SI and, given that this compliance is one of the big purposes of the package, we can suppose you want to comply too. So that's a hint siunitx gives you.

\documentclass{article}
\usepackage{siunitx}

\begin{document}

... dimensions of at least \SI{0.5}{\astronomicalunit}.

\end{document}

That gives you:

enter image description here

Now, if you really, really want to render it differently, or if you are forced to it, you can always redefine it. (Not recommended).

\documentclass{article}
\usepackage{siunitx}

\DeclareSIUnit{\astronomicalunit}{[a.u.]}

\begin{document}

... dimensions of at least \SI{0.5}{\astronomicalunit}.

\end{document}

enter image description here

Update: Given the update of the OP. In the spirit of the above. If I want to render an "arbitrary unit", I'd first look if it is predefined in siunitx. If it is, I'd use it. If not, one can always define it (ideally checking then what's the SI standard for it).

\documentclass{article}
\usepackage{siunitx}

\DeclareSIUnit{\arbitraryunit}{a.u.}

\begin{document}

... dimensions of at least \SI{0.5}{\arbitraryunit}.

\end{document}
  • 1
    +1. Redefining \astronomicalunit should be considered preferable in my opinion so the snippet \SI{0.5}{\astronomicalunit} will retain meaning if copied elsewhere. – Dai Bowen Jan 17 '18 at 10:03
  • 3
    According to the SI Brochure, page 128, ua is the only right way. Hence the choice made in siunitx See (bipm.org/en/publications/si-brochure). – Denis Jan 17 '18 at 10:05
  • 1
    I aggree with both of you. But I'm not really sure what the OP means by "a.u." (atomic units perhaps?). I'd go with the predefined, which will be in accordance to SI. But if the change is really desired, then redefine the correct unit (I will update the answer to reflect this). – gusbrs Jan 17 '18 at 10:09
  • 1
    Yes, following SI is best practice (which siunitx does), if the OP wants to deviate from SI (or use a non-SI unit) and siunitx already defines a macro for the unit then they should redefine that with \DeclareSIUnit, otherwise they should define a new unit macro as necessary. – Dai Bowen Jan 17 '18 at 10:12
  • The International Astronomical Union apparently prefer "au", and the BIPM have accepted this as of the 2014 update (Wikipedia has more info). Not that most astronomers I know use SI consistently, some even use CGS still – Chris H Jan 17 '18 at 11:31
3

What about placing [a.u.] inside braces?

\documentclass{article}
\usepackage{siunitx}
\begin{document}
... dimensions of at least \SI{0.5}{{[a.u.]}}
\end{document}

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.