Zero:0.6.0 Release

Zero 0.6.0

The new version 0.6.0 of Zero brings many updates and improvements including

  • exponent modes for fixed, scientific, and engineering formatting,
  • new rounding modes and options for rounding ties, and
  • improvements for unit formatting.

The full changelog is listed below.

What is Zero?

Zero is a package for formatting numbers in a consistent and scientifically accurate way, e.g., num[1.7+-0.2e5]. Also, for tables it provides alignment of numerals at the decimal point (and more). Check out the detailed documentation via the link above.

#import "@preview/zero:0.6.0": num, format-table, zi

Physicists estimate a number of #num[1e80] particles in the observable universe. 

#figure({
  show: format-table(none, auto)
  table(
    columns: 2,
    [1], [1.2], 
    [2], [2], 
    [3], [300]
  )
})

#let Js = zi.declare("J s")
Plancks constant is roughly #Js[6.626e-34]. 

Changelog

Exponent modes and rounding improvements

Exponents:

  • :warning: Breaking Change: Removes the parameter num.fixed which is now replaced by the exponent mode fixed (see below).
  • Adds new exponent modes:
    • auto for standard formatting,
    • "sci" for automatic scientific notation,
    • (fixed: n) for fixing the exponent to a specific value, and
    • "eng" for automatic engineering notation.
  • Improves rendering of exponents for math: true to guarantee a look just like the number was generated by hand with an equation.

Rounding:

  • :warning: Breaking Change: Renames rounding modes "down" to "towards-negative-infinity" and "up" to "towards-infinity".
  • Adds an option round.ties to configure the behavior for rounding the digit 5.
  • Adds two new rounding directions "towards-zero" and "away-from-zero".
  • Adds support for padding with a minimum number of digits.
  • Fixes rounding when no integer part is given (like num[.5]).

Units:

  • Fixes spacing with angle units (there should be no space between the number and an angle unit).
  • :warning: Breaking Change: The unit alternatives with British spelling zi.metre and zi.litre have been removed for consistency and to avoid confusion.
  • Adds an option unit.lowercase-liter that enables a lower case symbol for the unit liter.

Miscellaneous:

  • Fixes parsing of [#""] values in formatted tables.

How to support this project

If you want to support this open-source work, you can sponsor the project with a small amount. You can also contribute by opening issues and pull requests.

1 Like