The page numbers appear left aligned as soon as some have multiple digits. While this could be easily fixed by setting the alignment of the third column to bottom + right it would make the line of dots stop earlier for entries with a single digit page number so it is necessary to merge the second and third column.
Comparing note-outline to the built-it outline for headings, I noticed that outline wraps text differently and allows text to go above the page number. Personally, I like that note-outline forces text to break right before the page number by using separate columns of a grid, so in my proposal below I kept the aesthetic.
Relevant part of drafting.typ:
|
grid( |
|
columns: (1em, 1fr, 10pt), |
|
column-gutter: 5pt, |
|
align: (top, bottom, bottom), |
|
box( |
|
fill: note-props.fill, |
|
stroke: if note-props.stroke == none { |
|
none |
|
} else if paint != note-props.fill { |
|
paint |
|
} else { |
|
black + .5pt |
|
}, |
|
width: 1em - 2pt, |
|
height: 1em - 2pt, |
|
), |
|
[#note-props.body #box(width: 1fr, repeat[.])], |
|
[#note.location().page()], |
|
), |
Proposed change of that section:
grid(
columns: (1em, 1fr),
column-gutter: 5pt,
align: (top, bottom),
box(
fill: note-props.fill,
stroke: if note-props.stroke == none {
none
} else if paint != note-props.fill {
paint
} else {
black + .5pt
},
width: 1em - 2pt,
height: 1em - 2pt,
),
[#box(width: 1fr, [#note-props.body #box(width: 1fr, repeat[.])]) #note.location().page()],
),
Before:

After:

Built-in outline for reference (which I personally actually don't like):

Example used to test different cases and generate the before and after screenshots:
#import "@preview/drafting:0.2.2": inline-note, note-outline
#note-outline()
#pagebreak()
// short entry
#inline-note[#lorem(10)]
#range(4).map(_ => pagebreak()).join()
// demonstrate word wrap with single digit page number
#inline-note[,,,#lorem(20)]
#inline-note[,,,,#lorem(20)]
#range(4).map(_ => pagebreak()).join()
// entry with double digit page number
#inline-note[#lorem(10)]
#range(4).map(_ => pagebreak()).join()
// demonstrate word wrap with double digit page number
#inline-note[,#lorem(20)]
#inline-note[,,#lorem(20)]
(I used commas to slightly push words to the edge and force a word wrap. Not sure if this is consistent across different systems/fonts)
PS: Is it possible to get syntax highlighting for typst in markdown code blocks? I tried ```typ and ```typst
The page numbers appear left aligned as soon as some have multiple digits. While this could be easily fixed by setting the alignment of the third column to
bottom + rightit would make the line of dots stop earlier for entries with a single digit page number so it is necessary to merge the second and third column.Comparing
note-outlineto the built-itoutlinefor headings, I noticed thatoutlinewraps text differently and allows text to go above the page number. Personally, I like thatnote-outlineforces text to break right before the page number by using separate columns of a grid, so in my proposal below I kept the aesthetic.Relevant part of
drafting.typ:typst-drafting/drafting.typ
Lines 407 to 425 in 4592eef
Proposed change of that section:
Before:

After:

Built-in

outlinefor reference (which I personally actually don't like):Example used to test different cases and generate the before and after screenshots:
(I used commas to slightly push words to the edge and force a word wrap. Not sure if this is consistent across different systems/fonts)
PS: Is it possible to get syntax highlighting for typst in markdown code blocks? I tried ```typ and ```typst