l

luzid-checkbox

@preview

Write checklists in a markdown syntax and use icons like many Obsidian themes.

v0.2.0
GPL-3.0-or-later

Package Information

Last Updated
Authors
z1glr
Categories
componentsvisualizationtext

1. Get the package

Download the package using the TPIX CLI:

tpix get @preview/luzid-checkbox:0.2.0

2. Import in your Typst file

Add this to your .typ file:

#import "@preview/luzid-checkbox:0.2.0": *

Version History

0.2.0
43f843a8d57e...
0.1.0
d59dad7e547b...

Write checklists in a markdown syntax and use icons like many Obsidian themes.

Usage

Take native bullet lists to the next level with checkboxes to keep track of tasks
and other bullet points.
This can be achieved by using the Markdown syntax and its extension from the
Obisidan theme Minimal
.

Example

#import "@preview/luzid-checkbox:0.2.0": luzid

#show: luzid

- [ ] task
- [x] done
- [>] rescheduled
- [<] scheduled
- [!] important
- [-] cancelled
- [/] progress
- [?] question
- [\*] star
- [n] note
- [l] location
- [i] information
- [I] idea
- [S] amount
- [p] pro
- [c] contra
- [b] bookmark
- [\"] quote
- [u] up
- [d] down
- [w] win
- [k] key
- [f] fire

Typst output for the previous code; a list with colored icons instead of bullet points

Defaults

The default icons are from Lucide Icons and the colors from
the latte palette of the catppuccin theme.

Configuration

The color, icon and styling for each type of box can be overwritten.
Only the boxes specified get overwritten, the rest stays at the default values:

#import "@preview/luzid-checkbox:0.2.0": luzid

#show: luzid.with(
 color-map: (
  task: rgb("#0000ff"),
 ),
 marker-map: (
  done: "icons/pin.svg", // path to a different icon
 ),
 style-map: (
  important: it => text(weight: "bold")[#it], // wrapping function
 ),
)

- [ ] Icon color
- [x] Icon
- [!] Styling

Custom icons

When a svg is detected, the template replaces the string "currentColor" inside the
svg with the rgb-hex-value of the markers-color.
Use this for changing the color of the icon.

Typst output for the previous code; 3 checkboxes with modified color, icon and styling

Bonus

This also works when using the document converter pandoc
to create PDF files from Markdown through typst.
Pandoc replaces the the empty and checked boxes with ☐ (U+2610) and ☒ (U+2612).
They too get replaced by their respective styles.