josephwright / josephwright/siunitx

Support for the k notation in the \num command

Open
#378 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

First: thanks for the awesome work you're doing.

I have a feature request:

In some fields of science (e.g. computer science, e.g. this paper) large numbers without units are often abbreviated using the kilo prefix.

Examples:

After 21k iterations, the loop was terminated.

There are possible workarounds:

\documentclass{article}
\usepackage{siunitx}
\DeclareSIUnit\k{k}
\begin{document}
After \SI{21}{\k} iterations, the loop was terminated
\end{document}
\documentclass{article}
\usepackage{siunitx}
\begin{document}
After \SI{21}{\kilo{}} iterations, the loop was terminated.
\end{document}

However, both seem hacky and not very elegant.

I would much more prefer a solution like:
\num{21k} or \num[k-notation = true]{21000}

Thanks.

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.

Research direction

The \num command is the entry point named in the request; first inspect how it currently parses and formats a value, then compare the proposed \num{21k} and k-notation option semantics. Done means one documented, consistent k-notation behavior that handles the example and has corresponding verification.

Written by the indexing model from the issue text.

Assessment

Tech stack
latex
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.