4

Consider the following example.

I would like to use the \SI command from siunitx to type the following:

\documentclass{article}

\usepackage[separate-uncertainty=true]{siunitx}

\begin{document}

\noindent What I have:
\[
  \SI{6.67384(80)e-11}{\N\square\m\per\square\kg}
\]
What I would like:
\[
  \num{6.67384(80)e-11}\,\si{\N\square} \cdot (\si{\m/\kg})^{2}
\]

\end{document}

output

8
  • The current situatuion is that you can'd do this directly using the tools in the package.
    – Joseph Wright
    May 21, 2013 at 14:32
  • Is the desired output consistent with SI's specifications?
    – egreg
    May 21, 2013 at 14:33
  • @egreg I'm not sure. :( I just made the assumption that it is possible with siunitx, considering the versatility of the package. May 21, 2013 at 14:39
  • @SvendTveskæg With respect to consistency, please have a look at "SI Unit rules and style conventions", available at physics.nist.gov/cuu/Units/checklist.html.
    – user13907
    May 21, 2013 at 16:03
  • @Papiro Good point. Even though it seems it be against the rules and conventions, I would like to have it as explained. Can it be done with \SI? May 21, 2013 at 16:07

1 Answer 1

1

I think, Joseph is wrong. You can do this very easily with siunitx, although it seems a bit unaesthetical:

\documentclass{article}
\usepackage[separate-uncertainty=true,inter-unit-product=\ensuremath{{}\cdot{}}]{siunitx}
\DeclareSIUnit{\myunit}{(m/kg)}
\begin{document}
\[
\SI{6.67384(80)e-11}{\N\myunit\squared}
\]
\end{document}
5
  • 3
    I meant that you can't auto-format from \N\square\m\per\square\kg.
    – Joseph Wright
    May 21, 2013 at 16:27
  • Even if there were some functionality involved, no software could completely auto-format out of this given input, because markup is missing. How should the software know, which units should be inside the brackets and which not?
    – Toscho
    May 21, 2013 at 19:26
  • The question doesn't make it explicit, but I was working on the assumption that the brackets were meant to cover 'units raised to the same power'.
    – Joseph Wright
    May 21, 2013 at 21:13
  • @JosephWright It is indeed meant to cover units raised to the same power. May 21, 2013 at 22:08
  • @SvendTveskæg: What reason is there behind grouping units with the same power? It seems to me, that in general it's more important to have compound units with special meanings like m/s^2 or eV. Creating them is possible with SIunitx. In this example, there is only one caveat: What if you want that compound unit m/kg singularly and therefore without parentheses?
    – Toscho
    May 22, 2013 at 6:33

You must log in to answer this question.

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