Leedehai / typst-physics

physica: vectors, fields, differentials, derivatives, Dirac brakets, tensors, and more. See examples in the manual PDF.
https://github.com/Leedehai/typst-physics
MIT License
343 stars 11 forks source link

add commutator #37

Closed oameye closed 6 hours ago

oameye commented 18 hours ago

Could we add the commutator and anticommutator just as in the latex physics package?

YDX-2147483647 commented 14 hours ago

Maybe literal [] {} are enough?

$ [tilde(A), {tilde(B), tilde(C)}] + [f(x), {x, y}]. $

this also happens automatically for delimiters that match syntactically —Left/Right Functions – Typst Documentation

Leedehai commented 6 hours ago

Hi I considered that but concluded [] and {} are enough. Typst is able to automatically adjust the height of the delimiters based on the content within, but LaTeX can't do that (i.e. you have to manually add \left, \right) and I guess that's why the physics package for LaTeX has them.