josephwright / josephwright/siunitx

Syntax for "quantity/unit"

Open
#305 2 comments 0 reactions 1 assignee View on GitHub

@josephwright is already working on this.

Since Jun 4, 2017.

enhancement
Dominant language
TeX
Stars
407
Forks
29
Avg merge
11h 20m
Merged PRs (30d)
3

Description

Sometimes, units are best expressed as a denominator below the corresponding quantity/description as in section 9.3 of the documentation:

In graphs and tables, repetition of the units following each entry or axis mark is confusing and repetitive. [...] Much better is to show division of all quantities by the unit, which leaves the entries as unitless ratios.

Also from SI brochure:

For example, the equation T = 293 K may equally be written T/K = 293. It is often convenient to write the quotient of a quantity and a unit in this way for the heading of a column in a table, so that the entries in the table are all simply numbers. [...] The axes of a graph may also be labelled in this way, so that the tick marks are labelled only with numbers, as in the graph below.

I'd be happy if there is a macro for this purpose. Let me call it \varSI (maybe there should be a better name though) and interface I'm thinking is like

\documentclass{article}
\usepackage{siunitx}
\begin{document}
\begin{tabular}{rr}
  Syntax & What it looks like \\
  \hrule
  \varSI{time}{\second} & time/si{\second} \\
  \varSI{mass}[e3]{\kilo\gram} & mass/SI{e3}{\kilo\gram} \\
  $\varSI{c}{\meter\per\second}$ & $c/\si{\meter\per\second}$ (or $c/(\si{\meter\per\second})$?)
\end{tabular}
\end{document}

In the last example, I'm not sure if the unit with multiple components should be grouped by an explicit parens. I couldn't find authoritative references regarding this point.

Not only \varSI looks more semantic to me at least, but I also believe that introducing this kind of stuff will encourage the users to more respect SI-compliant notation.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.