Package Information
- Last Updated
- Minimum Typst Version
- 0.14.0
- Authors
- Marius Bär
- Categories
- visualization
- Dependencies
- @preview/cetz:0.5.2
1. Get the package
Download the package using the TPIX CLI:
tpix get @preview/piclabeler:0.1.02. Import in your Typst file
Add this to your .typ file:
#import "@preview/piclabeler:0.1.0": *Piclabeler
Typst package to annotate images with labels and arrows.
Piclabeler uses the Typst drawing library CeTZ to place an image on a canvas with a guiding grid and provides functions to annotate it.
It is similar to the LaTeX packages overpic or tikz-imagelabels.
Example
The following code creates an annotated image with two labels:
#import "@preview/piclabeler:0.1.0" as pl
#pl.annotated-image(
width: 10cm,
image-width: 80%,
// https://images.nasa.gov/details/B1B_Cargo_Expanded_View
image("B1B_Cargo_Expanded_View.jpg"),
{
let label = pl.label.with(
frame: "rect",
padding: 0.4em,
mark: (
end: ">>",
fill: black,
stroke: none
),
)
label([Cargo Fairing], (6, 0), to: (6, 4.3))
label([Boosters], (2, -2), to: ((-4.6, 1), (-2, -4.7)))
},
)
After placing the labels and arrows, the grid can be disabled by setting grid: none:
#pl.annotated-image(
grid: none,
// ...
)