u/CordeElCrack

Package for creating Physics diagrams
▲ 57 r/typst

Package for creating Physics diagrams

Hello everyone!

I have released a new package called `typed-physics`, a drawing library for creating Physics diagrams in Typst.

The objective of this library is that, apart from drawing, it also understands physics. Therefore, the drawing of the diagrams, as well as the code used to create them, follows the physical relationships between the elements.

Here is an example of the package: the ramps, grounds, objects and forces interact together nicely instead of having to manually position them like another library would do.

https://preview.redd.it/8a314vggz5jh1.jpg?width=1902&format=pjpg&auto=webp&s=cd29e280e469af72189aed916f12e200ce58dad1

Here is also an example for springs. Multiple objects, forces and surfaces can be composed nicely.

https://preview.redd.it/axo8xrisz5jh1.jpg?width=1992&format=pjpg&auto=webp&s=92b31af6281c8923d90752d7a8f5ea75d85b0172

It currently supports: surfaces, blocks, pulleys, ropes, springs, applied forces, friction, and single-body mechanics on horizontal or inclined surfaces.

Every object and surface can be individually customized with colors, shapes, etc.

The package also offers a way to symbolically solve certain mechanics situations, although it does not support any arbitrary situation.

I’d love to hear your feedback, suggestions, or ideas for situations it should support next!

GitHub: https://github.com/GeronimoCastano/typed-physics
Typst Universe: https://typst.app/universe/package/typed-physics

Disclaimer: The package was developed with the help of Artificial Intelligence.

reddit.com
u/CordeElCrack — 7 days ago
▲ 69 r/typst

Typst package for western musical notation

Hello everyone!

I have released a package called typed-scores , a package for engraving western musical notation in Typst!

It uses a compact syntax for notes, chords, rests, durations, articulations, dynamics, ties, slurs, tremolos and much more. It supports multiple voices, multiple stave and orchestra-like scores.

Here is an example of Chopin's Nocturne in E-Flat Major, Op 9 No 2, written completely inside Typst:

https://preview.redd.it/lf8mxc1teteh1.png?width=2970&format=png&auto=webp&s=89b2d06b897c206de278cfbcb7c7226247a2a945

Or "Eine kleine Nachtmusik" by Mozart with all its four voices:

https://preview.redd.it/jwvljcnafteh1.jpg?width=1414&format=pjpg&auto=webp&s=905876b3113dbee950e0025e1e21c2c9ce3e1f4e

The package is built with a Rust parser and the rendering is done with the Bravura font on top of CeTZ.

Please check it out at: https://typst.app/universe/package/typed-scores for notation and score examples.

The GitHub is https://github.com/GeronimoCastano/typed-scores for issues or feature requests.

Disclaimer: The package was developed with the help of Artificial Intelligence.

reddit.com
u/CordeElCrack — 29 days ago
▲ 64 r/typst

I made a Typst package for automatically drawing data structures and algorithm steps.

Hi everyone! I made typed-dsa, a Typst package built with CeTZ for drawing data structures and visualizing their operations.

Instead of manually positioning every node, you provide the underlying values or adjacency data. The package constructs the structure, calculates its layout, and renders the result automatically. It supports BSTs, AVL trees, min- and max-heaps, graphs, linked and doubly linked lists, stacks, queues, arrays, and matrices.

Trees and heaps also expose operations directly on the returned object. These operations produce a labeled before-and-after transition, highlight the affected values, and return the resulting structure so operations can be chained. (you can customize the highlights as well as to whether or not display the steps or just the final result). The syntax works like object oriented programming: you call the method ".insert(5)" into the object, which itself retuns another object instance:

https://preview.redd.it/fy1adblk26ch1.jpg?width=1758&format=pjpg&auto=webp&s=db9f25084836a3a0a8d0f14fdea55a1119518f35

https://preview.redd.it/sqm6d8ql26ch1.jpg?width=1664&format=pjpg&auto=webp&s=2ffaac4eaccd676b41ebb454bff209b0d4ea7d78

Graphs can be created from an adjacency dictionary using automatic circular layout, or with explicit positions for complete manual control.

https://preview.redd.it/g4thiyuo26ch1.jpg?width=880&format=pjpg&auto=webp&s=546125c41a4f534bbfa8509184721dd1264c7d28

Trees can also be hand-composed when the structure is conceptual rather than generated from insertion order. The node and subtree helpers are useful for textbook diagrams.

https://preview.redd.it/syrwho3r26ch1.jpg?width=1638&format=pjpg&auto=webp&s=7403fdd2eff1f1b88b87891cf39b5f8e71de292b

Practically everything is customizable. Color, fill, size, font weight, rotation, etc. for every data structure.

Finally, it also supposes array, matrices and linked structures:

https://preview.redd.it/8s7olqu036ch1.jpg?width=1236&format=pjpg&auto=webp&s=b186ce1076ee690c778f4e40d3e6f786f5c4e0b4

https://preview.redd.it/7hxe42f136ch1.jpg?width=702&format=pjpg&auto=webp&s=d68df767bb46894d14ff865762f5f2b33e5e6ac2

Please try it out with:

#import "@preview/typed-dsa:0.1.0": *

At: https://typst.app/universe/package/typed-dsa

GitHub: https://github.com/GeronimoCastano/typed-dsa

Please try it out and tell me what you think! I would appreciate any suggestions you may have.

reddit.com
u/CordeElCrack — 1 month ago

I made a Typst package for drawing SMILES molecules

Hi everyone, I’ve been working on a Typst package called typed-smiles for rendering SMILES strings as 2D molecular diagrams.

It is still in early development, so it doesn't yet understand Stereochemistry and some SMILES syntax may not be supported yet.

It lets you write things like:

smiles("NC(CC1=CC=CC=C1)C(=O)O")

And the correct SMILES-parsed molecule will be displayed using the CeTZ Typst package:

https://preview.redd.it/fb4tfasyb24h1.png?width=558&format=png&auto=webp&s=70fe5e22b2d18742990a4142e8c7343d04931ff9

It also can write chemical equations:

ce("CH4 + 2O2 -> CO2 + 2H2O")

https://preview.redd.it/kk0mpxy1c24h1.png?width=1012&format=png&auto=webp&s=6b449a3e3534a790a8a12a3cc4de7aa7a99a7261

And even more complex molecular diagrams with #reaction(): that can be labeled, and mixed with SMILES strings and chemical equations.

https://preview.redd.it/pa7g6qb3c24h1.png?width=1080&format=png&auto=webp&s=b242871e7b576ebf6c8a1b49d8f79b36423ea450

It also has helpers for reaction arrows, multi-step schemes, atom colors, charges, wedge/hash bonds, and optional implicit hydrogens.

Please, for the Chemists out there that use Typst, give this package a try by importing it:

#import "@preview/typed-smiles:0.1.1": smiles, ce, reaction, rxn-arrow, mol

And taking a look at the README.md file from the Typst Universe:

https://typst.app/universe/package/typed-smiles

If you have any issues or any ideas that we can put into the package, please reach out in the GitHub repository:

https://github.com/GeronimoCastano/typed-smiles

NOTE:

I acknowledge this post is self-promotion, which goes against the guidelines. This message was approved by an r/chemistry moderator beforehand.

reddit.com
u/CordeElCrack — 3 months ago
▲ 92 r/typst

I made a Typst package for rendering SMILES strings as 2D Molecular Diagrams.

Hi everyone, I’ve been working on a Typst package called `typed-smiles` for rendering SMILES strings as 2D molecular diagrams.

It lets you write things like:

#smiles("NC(CC1=CC=CC=C1)C(=O)O")

And the correct SMILES-parsed molecule will be displayed using the CeTZ Typst package:

https://preview.redd.it/mzw60w6q2n3h1.jpg?width=558&format=pjpg&auto=webp&s=d37753e0a759f406df58027939da5a4e7e7d266b

It also can write chemical equations:

#ce("CH4 + 2O2 -> CO2 + 2H2O")

https://preview.redd.it/t534fgp52n3h1.jpg?width=1012&format=pjpg&auto=webp&s=80d34917c9e2fd1d8bacd529682b03bc707a6b9a

And even more complex molecular diagrams with #reaction(): that can be labeled, and mixed with SMILES strings and chemical equations.

https://preview.redd.it/yczykc9a2n3h1.jpg?width=1552&format=pjpg&auto=webp&s=255d0031c463ab8c4dcdfa115f5749943ad6aba4

It also has helpers for reaction arrows, multi-step schemes, atom colors, charges, wedge/hash bonds, and optional implicit hydrogens.

Please, for the Chemists out there that use Typst, give this package a try by importing it:

#import "@preview/typed-smiles:0.1.0": smiles, ce, reaction, rxn-arrow, mol

And taking a look at the README.md file from the Typst Universe:

https://typst.app/universe/package/typed-smiles

If you have any issues or any ideas that we can put into the package, please reach out in the GitHub repository:

https://github.com/GeronimoCastano/typed-smiles

reddit.com
u/CordeElCrack — 3 months ago