lib module

render-mol function

#let render-mol(data, record: 1, abbreviate: false, skeletal: false, dump: false, config: (:), annotations: none, show-indices: false, fidelity: "ignore")

Documentation

Render a molecule from Molfile or SDF data.

Input coordinates are preserved when they form a usable 2D layout. Records with collapsed or numerically unstable coordinates are laid out with Coordgen. On Typst 0.15.0 and later, data may be a path; earlier versions should pass the result of read.

Parameters

  • data (any): Molfile/SDF text, bytes, or a Typst 0.15.0+ path.
  • record (int): One-based record number for multi-record SDF input. Default: 1.
  • abbreviate (bool): Fold common hydrogens and terminal groups into labels. Default: false.
  • skeletal (bool): Draw a skeletal formula; overrides abbreviate. Default: false.
  • dump (bool): Show generated Alchemist source instead of rendering. Default: false.
  • config (dictionary): Alchemist configuration plus optional ctfile overlay styling. Default: (:).
  • annotations (dictionary, array, none): Overlay annotation or annotation array. Default: none.
  • show-indices (bool, str): Show "atoms", "bonds", or "all" indices for authoring. Default: false.
  • fidelity (str): "ignore" or "strict" handling of remaining depiction gaps. Default: "ignore".

Returns

content

Defined in lib.typ:1329.

Source

Module
lib
Defined in
lib.typ:1329
Source
View source