Universe

CI Latest release

The manual. Download releases here.

Available at the official collection of Typst packages.

This Typst package provides handy typesetting utilities for physics, including:

  • Braces,
  • Vectors and vector fields,
  • Matrices,
  • Dirac braket notations,
  • Common math functions,
  • Differentials and derivatives, including partial derivatives of mixed orders with automatic order summation,
  • Familiar “h-bar”, tensor abstract index notations, isotopes,
  • Signal sequences i.e. digital timing diagrams.

:warning: Typst is in beta and evolving, and this package evolves with it. As a result, no backward compatibility is guaranteed yet.

:information_source: In response to the official Typst package guideline “Package names should not be merely descriptive to create level grounds for everybody”, this package was renamed from physics to physica.

A quick look

See the manual for more details.

demo

Using physica in your Typst document

With typst package management (recommended)

See https://github.com/typst/packages.

effect

// Style 1
#import "@preview/physica:0.8.1": *

$ curl (grad f), tensor(T, -mu, +nu), pdv(f,x,y,[1,2]) $
// Style 2
#import "@preview/physica:0.8.1": curl, grad, tensor, pdv

$ curl (grad f), tensor(T, -mu, +nu), pdv(f,x,y,[1,2]) $
// Style 3
#import "@preview/physica:0.8.1"

$ physica.curl (physica.grad f), physica.tensor(T, -mu, +nu), physica.pdv(f,x,y,[1,2]) $

Without typst package management

Similar to examples above, but import with the undecorated file path like "physica.typ".

Manual

See the manual physica-manual.pdf for a more comprehensive coverage, a PDF file generated directly with the Typst binary.

CLI Version:

$ typst --version
typst 0.8.0 (360cc9b9)

To regenerate the manual, use command

typst watch physica-manual.typ

Contribution

  • Bug fixes are welcome!

  • New features: welcome as well. If it is small, feel free to create a pull request. If it is large, the best first step is creating an issue and let us explore the design together. Some features might warrant a package on its own.

  • Testing: currently testing is done by closely inspecting the generated physica-manual.pdf. This does not scale well. I plan to add programmatic testing by comparing rendered pictures with golden images.

License