a

atomic

@preview

Draw Atoms, their electron configurations, shells and orbitals in Typst.

v1.0.0
MIT

Package Information

Last Updated
Authors
Aarav Garg
Categories
layouttextpaper
Disciplines
educationchemistry

1. Get the package

Download the package using the TPIX CLI:

tpix get @preview/atomic:1.0.0

2. Import in your Typst file

Add this to your .typ file:

#import "@preview/atomic:1.0.0": *

Version History

1.0.0
880d39535311...

Typst Package
MIT License

Draw Atoms in Typst

Draw simple atomic models consisely using the power of CeTZ and Typst.

Usage

To draw a simple atom use

#atom(atomic number (proton count), mass number (neutron count), electrons per shell, shells: 1.0, step: 0.4, center: 0.6, color: luma(90%))

The electrons should be passed in an array where the index corresponds to the shell, while the value is the amount of electrons on that shell. Here is an example:

#atom(29,64, "Cu", (1, 8, 18, 2))

image

You can also auto-populate orbitals.

#atom(29,64,"Cu",29)

To draw the same in a CeTZ canvas, use draw-atom, which takes the same arguments as atom

#cetz.canvas({
  draw-atom(29,64, "Cu", (1, 8, 18, 2))
})

If you'd like to exclusively draw the shells (for example to draw your own core) use draw-orbital(radius, electrons, color: luma(90%))