dromell f4c3fc7f61 fix: measure the description width instead of estimating it
With left-labels a description is placed by subtracting its width from
desc-x. That width was estimated as half the font size per character,
which undershoots Ubuntu Mono's advance of 0.56em by 12%, so the leader
line struck through the last letter of every label, as it does on the
manual's own cover page. Proportional fonts were off by more.

render is now a context block, so the text can be measured instead. The
font has to be passed explicitly: the set rule at the top of render is
not in scope for a measure further down the same context block.
2026-08-25 14:51:19 +02:00
2024-05-19 10:17:37 +00:00
2026-06-15 13:16:04 +02:00
2026-06-15 12:42:36 +02:00

rivet-typst

RIVET (Register / Instruction Visualizer & Explainer Tool) is a Typst package for visualizing binary instructions or describing the contents of a register, using the CeTZ package.

It is based on the homonymous Python script

Examples

A black on white diagram showing the bit structure of a machine instruction, detailing operands, flags and selectors.
A bit of eveything
A white on blue diagram showing the bit structure of RISC-V memory instructions, detailing operands, flags and selectors.
RISC-V memory instructions (blueprint)

Click on the example image to jump to the code.

Usage

For more information, see the manual

To use this package, simply import schema from rivet and call schema.load to parse a schema description. Then use schema.render to render it, et voilà !

#import "@preview/rivet:0.3.1": schema
#let doc = schema.load(yaml("path/to/schema.yaml"))
#schema.render(doc)
S
Description
Register / Instruction Visualizer & Explainer Tool with Typst, using CeTZ
https://typst.app/universe/package/rivet Readme Apache-2.0
3.8 MiB
V0.3.1
Latest
2026-06-16 13:35:06 +00:00
Languages
Typst 99.2%
Just 0.8%