• Stars
    star
    302
  • Rank 137,505 (Top 3 %)
  • Language Typst
  • License
    MIT License
  • Created over 1 year ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

physica: vectors, fields, differentials, derivatives, Dirac brakets, tensors, and more. See examples in the manual PDF.

The physica module (for physics)

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.

⚠ī¸ Typst is in beta and evolving, and this package evolves with it. As a result, no backward compatibility is guaranteed yet.

ℹī¸ 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.0": *

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

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

$ 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

More Repositories

1

CS110Notes

1st time TAing for CS110 at Stanford: Principles of Computer Systems? - Stars are appreciated :)
HTML
64
star
2

nostalgia-vscode

VSCode's true icons: blue & simplistic infinity
13
star
3

C-include-2-dot

C/C++ header dependency list generator. Output can be used to create a dependency graph.
Perl
12
star
4

expandable-tree-list

Clickable tree view for JSON content. Single HTML file, no libraries required.
HTML
11
star
5

make-output-prettify

Makefile output prettifier: let Make's output be succinct! (v1: no line eliding; v2: with line eliding like Ninja)
Python
5
star
6

ubuntu-on-virtualbox

Installing a headless Ubuntu on VirtualBox or Docker: Linux, server, SSH, shared folder.
5
star
7

readelf-python

Python tool to read ELF format, more hackable than GNU's readelf
Python
5
star
8

RNN-seq2seq

Recurrent Neural Network sequence-to-sequence model (Natural Language Processing) with pedagogically verbose comments, EXCERPT from course project
Python
2
star
9

abseil.gn

The Abseil C++ library with GN build files.
C++
1
star
10

ctimer

[CI enabled] Measure a program's processor time with timeout
C++
1
star
11

GNTest

Taken from Google GN repo's example, and fixed the original's bug of being broken on Mac.
C++
1
star
12

cross-compile-to-linux

Intro to cross-compiling from macOS/Linux to Linux using Clang in 2 steps
C++
1
star
13

Camel2Snake

Variable names in C++: camelCase to snake_case (why? I like Chromium!)
Python
1
star
14

sblz

[CI enabled] Async-signal safe symbolizer and demangler for Itanium C++ ABI (macOS, Linux, etc.)
C++
1
star
15

CppSupplementaries

C++ notes: the basics, class, polymorphism, templates, STL, etc. Composed long ago in Typora (may contain format error).
1
star