Forum How do I...?

Footnotes with glyphs: *, † (dagger), ‡ (double-dagger) etc

Chris Thorman
Hi,

I am typesetting a book in which footnote numbering begins anew on each page, but the counters are not numerals; they’re special glyphs (characters). 1 = * (asterisk), 2 = † (dagger), 3 = ‡ (double-dagger), etc. (a defined sequence that always starts anew on each page).

This is a pretty standard footnoting style.

I have no problem getting the footnote counter to reset on each page.

But I'm having trouble using glyphs instead of numerals for the counters. What I want is some way to globally indicate the mapping between the per-page footnote counter and glyph.

Idea 1:

I tried finding some sort of selector nesting where nth-of-type would work, for example:

@footnotes .fn::footnote-marker:nth-of-type(1) {content: "*"}
@footnotes .fn::footnote-marker:nth-of-type(2) {content: "†"}
@footnotes .fn::footnote-marker:nth-of-type(3) {content: "‡"}

@footnotes .fn::footnote-call:nth-of-type(1) {content: "*"}
@footnotes .fn::footnote-call:nth-of-type(2) {content: "†"}
@footnotes .fn::footnote-call:nth-of-type(3) {content: "‡"}

Also, @page was tried.

Also, I tried the above with and without the ">" operator, e.g.

@footnotes > .fn::footnote-marker:nth-of-type......

But @footnotes and @page are not able to act as parent selectors, apparently; these rules have no effect.

I also tried just nesting the above rules inside @footnotes { } or @page { } (or both!), but again, they have no effect.

If I omit the @footnotes or @page, and have no parent selector and no nesting, then "n" is always 1, and I get nothing but * (asterisk) as the marker.

It seems like I would need some sort of virtual div class I could use for the footnotes on a given page; I suppose this is something that prince would have to define behind the scenes, but could be used in a stylesheet. Perhaps:

div.prince-footnotes .fn::footnote-marker:nth-of-type(1) {content: "*"}

That method would work for markers, but would it work for the calls, too? I suppose this virtual div would have to surround the entire page so that the calls and markers are both "within" it.

Idea 2:

I also explored whether there is some sort of function that can be used with content: to map the footnote counter to a particular string, for example, if there were a char() function that could pull out one character from a string, I could do this:

.fn::footnote-marker {content: char(counter(footnote), "*†‡")}

Idea 3:

I also looked into whether there's any way in css to use list-styles for this, and then to define a custom style, but I found nothing like this.

--------

Is there some other way to do this?

If not, any chance of getting support in prince for something akin to Idea 1 (virtual div containing everything on a page), or Idea 2 ("char" function) ?

Sincerely,

-c
mikeday
The trick is to use counter(footnote, symbols('a', 'b', ...)) for the content of the footnote-call.
Chris Thorman
This worked -- thanks!
mknight
I'm also trying to use symbols instead of numerals for footnote callouts. I have added this CSS, but I am still getting numerals:

.fn::footnote-call {
content: counter(footnote, symbols ('*', '†'));

Is there something missing here?
mikeday
There should be no space after "symbols" as it's a function, "symbols(...)"
mknight
Doh! Thanks Mike
howcome
Good use case, I've added custom number styles to the guide on making footnotes:

https://css4.pub/2023/footnotes/#custom-number-styles

Edited by howcome

mknight
Thanks howcome