Forum How do I...?

Footnote marker superscript

BlueChilli
Hello,

We are using Prince 9, and I have successfully managed to integrate footnotes and also making the call (the marker appearing in the middle of the document) be superscript. But the marker next to the footnote on the footer of the document doesn't appear as superscript.

We've added:
.page-footnote::footnote-call { content: "" counter(footnote, decimal) ""; vertical-align: super; font-weight: bold; }
.page-footnote::footnote-marker { content: "" counter(footnote, decimal) ""; vertical-align: super; font-weight: bold; }

to no avail. Which then led me to look at the samples of Prince. This one in particular:

http://www.princexml.com/howcome/2010/magic/prince7.html
The HTML source calls for the marker to be super scripted:

.footnote::footnote-marker {
vertical-align: super;
font-size: 0.8em;
padding-right: 0.4em;
}

But the resulting PDF
http://www.princexml.com/howcome/2010/magic/prince7.pdf

Isn't so. Perhaps it's a bug in Prince or am I doing something wrong?
mikeday
Footnote markers are treated similarly to list item markers, and it seems that when the marker is outside the block we force the vertical alignment of the marker to the baseline of the main block. You can move the marker inside the main block, after which vertical alignment will work as expected:
.footnote { footnote-style-position: inside }

The same thing works for list markers:
li { list-style-position: inside }
BlueChilli
Very cool indeed. That did the trick. Cheers mate.
chops
So it's not possible to use footnote-style-position: outside and use a superscript footnote marker?
mikeday
No, I haven't found any way to do this currently.
lukasbestle
Hi,

Are there any news on this topic? As I need the following layout with subsequent lines indented with the first line like so:

1  A footnote
2  Another footnote
10 This footnote has a marker with two digit and is very long, so it
   is displayed in two lines.


I need to use footnote-style-position: outside. But then the vertical alignment (to the top in my case) won't work. :(

Regards,
Lukas
lukasbestle
As a workaround, I have tried to use an absolutely positioned ::before box like this:

.footnote {
  float: footnote;
  position: relative;

  margin-left: 1.2rem;
}

.footnote::footnote-marker {
  content: '';
}

.footnote::before {
  content: counter(footnote);

  position: absolute;
  left: -1.2rem;

  vertical-align: top;
  font-size: 0.7rem;
}


What's amazing is that it almost works. The only issue is that elements that are floated into the footnotes box apparently can't have position: relative, so the absolutely positioned ::before boxes all end up at the top of the page stacked over one another instead of just 1.2rem left of the footnote content as desired.

@mikeday Is there something I am missing or is that workaround indeed not going to work? It would of course be even better if vertical alignment of the footnote markers was supported natively.
jaype
What seems to work for me is:
.footnote::footnote-marker{
	transform: translateY(-30%);
}

looks good to me, you can change it tho

Edited by jaype

lukasbestle
Ah, that's a clever hack!

The project I needed this for is already done now, but I will keep that in mind for next time. Thanks. :)
india.mcq
@jaype got me on the right track. I ended up using this to position the marker outside of the footnote. Raised and to the left.
transform: translate(-6px,-3px);

Edited by india.mcq