typst-drafting icon indicating copy to clipboard operation
typst-drafting copied to clipboard

Combination of margin-note and inline-note not very pretty

Open shahn opened this issue 9 months ago • 3 comments

I have been unable to achieve a combination of margin-notes and inline-notes that looks quite like I want (see the green box in the picture below, which I added manually). Perhaps I am missing an option to the library, or you do not mean to support such usage?

#import "@preview/drafting:0.2.2": margin-note, inline-note

#let t = [
  #table(columns: 2,
    [asdf],
    [foo],
    [bar],
    [baz],
  )
]
#v(0.5fr)
#margin-note[#t][table looks awkward and noisy]

#v(1fr)

#margin-note[#inline-note[#t]][Would be nice just to have the table outline like in the table to the left]

#v(1fr)

#inline-note[#t]

#v(1fr)

In general, #inline-note(par-break: false)[it would be nice to have an inline note option that would merge lines together into a single box, with multiple lines merged.]

#v(1fr)

#inline-note[But not like this, where the box is just a single large rectangle, but kind of "hugging" the content. The
par-break option is clearly meant for this, but it doesn't really help as seen above.]

#v(1fr)

#v(0.5fr)
Image

shahn avatar Apr 06 '25 11:04 shahn

Hi, thanks for raising the issue.

I would aggree that the green box does nicer - would you mind sharing the source for the green box? (or maybe you're even open to creating a PR?)

Regarding the wrapping of tables, I will try and investigate if it is possible to make the line wrapping less weird. Maybe we should just wrap all figures this way, in order to standardize it.

Tinggaard avatar Apr 07 '25 06:04 Tinggaard

I would love to contribute, but unfortunately I drew the green lines by hand, using a PDF editor :/ It's my second day with typst, so I am a complete beginner.

Thanks for your quick and helpful response. If I come up with a solution once I am more experienced with typst, I'll be sure to provide a PR.

shahn avatar Apr 07 '25 18:04 shahn

Thanks for clarifying, I was really interested as how you had managed to draw such a box in Typst, as it is not (to my knowledge) possible without a lot of hacks.

I will see if it is possible to wrap entire figures and omit the text highlighting within them.

What are your thougths, @ntjess?

Tinggaard avatar Apr 07 '25 20:04 Tinggaard