Customizing the numbering of margin notes

As mentioned in my other post, I am having problems customizing margin notes. I am using the Marginalia package.

For footnotes, I was able to set the footnote number to be superscripted in the text, but bold and not superscripted in the footnote itself:

I want able to do so using this code:

#show footnote.entry: it => {
	let loc = it.note.location()
	strong(numbering(
		"1",
		..counter(footnote).at(loc),
	))
	h(0.75em); it.note.body
}

I’d like to make my margin notes behave the same.

Using the marginalia.configure setup function I am able to make the number superscript in both the text and the margin note:

#let config = (
    numbering: (..i) => super(numbering("1", ..i)),
)
#marginalia.configure(..config)

Can I somehow wrangle the margin notes to behave similarly to the footnotes?

I found a hacky solution that identifies the note number and the actual notes from the elements they use internally. This is not specific to notes created with marginalia and can therefore also affect other content in your document! The solution is also very specific to your requirements and is not easily extendable. If you think that your request would make for a good feature, please open an issue here.

The solution replaces the function super() with the function strong() in every box inside an align element. This will only target the number in front of the note since the inline number is only wrapped in a box but not in an align element. You can also use the function super() inside the note since the “body” is wrapped in a block instead of a box.

#import "@preview/marginalia:0.1.4" as marginalia: note, wideblock
#let config = (
    numbering: (..i) => super(numbering("1", ..i)),
)
#marginalia.configure(..config)

#show align: it => {
  show box: it => {
    show super: it => strong(it.body)
    it
  }
  it
}

#lorem(20) #note[hello#super[there]] #lorem(20)

Please make sure that the code examples in your questions compile without error, especially for the second example that actually shows your issue. The import of marginalia was missing as well as the actual creation of the note.

2 Likes