Skip to content

Use general 'note' command & extend documentation #10

@th1j5

Description

@th1j5

I use typst drafting as the typst equivalent of todonotes.
I'm new to typst, which is why I struggled to get some equivalent functionality, but I think I managed:
I'd like to propose to

  1. add some extra examples in the documentation which show the usage of different variants of notes
  2. add a general #note command, which can switch between the inline & margin variant, with a default to margin.
    (or if not, also add this to the documentation as an example of working with it...)

If you are ok with this, I can send a PR (when I find some time)

A note, defaulting to a margin note:

#let note(inline: false, ..kwargs) = {
    if inline {
        inline-note(..kwargs)
    } else {
        margin-note(..kwargs)
    }
}

An example of defining custom todo-commands:

#let todo-ballon = rect.with(inset: 0.3em, radius: 0.5em)
#let todo-unsure = note.with(
        stroke: maroon,
        rect  : todo-ballon.with(fill: maroon.lighten(70%)))
#let todo-add = note.with(
        stroke: blue,
        rect  : todo-ballon.with(fill: blue.lighten(60%)))
#let todo-change = note.with(...)

Usage:

#todo-add(inline: true)[Inline todo note, showing that I should add something...]
#todo-add[Todo note in the margin, showing that I should add something here...]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions