ntjess / typst-drafting

Some common drafting utilities for the `typst` document typesetter
The Unlicense
52 stars 2 forks source link

out of bounds notes #5

Open Doublonmousse opened 8 months ago

Doublonmousse commented 8 months ago

margin notes don't seem to be able to flow across pages so they get cut off with only parts of the note shown if it can't fit on a single page

Screenshot 2023-11-13 at 18 29 26
ntjess commented 8 months ago

Unfortunately this is a tricky problem to solve. Margin notes are placed to avoid reflowing content, but this means they don't create natural breaks for themselves. I.e., there isn't an easy way to indicate the margin note should flow to the next page like this: https://github.com/typst/typst/issues/735 (when it's supported).

It's not ideal, but your best bet in the meantime is to manually specify dy: -<length> in the call to margin-note to ensure the full note is visible:

#import "@preview/drafting:0.1.1": margin-note, set-page-properties
#set page(height: 2in, margin: (right: 2in))
#set-page-properties(margin-right: 2in)

= Hello, world
#lorem(80)
#margin-note(dy: -3cm)[#lorem(20)]
#lorem(80)

image