Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Footnotes not supported #364

Closed
a-leithner opened this issue Jun 28, 2019 · 3 comments · Fixed by #711
Closed

Footnotes not supported #364

a-leithner opened this issue Jun 28, 2019 · 3 comments · Fixed by #711

Comments

@a-leithner
Copy link

The CSS Generated Content for Paged Media Level 3 Working Draft (May 2014) and also the Editor's Draft (March 2019) provide support for footnotes using the following HTML and CSS:

<style>
@page {
    counter-reset: footnote 0;
}

@page {
    @footnote {
        float: bottom;
    }
}

span.footnote { float: footnote; }
.footnote::footnote-call { content: counter(footnote) " "; }
.footnote::footnote-marker { content: counter(footnote) ". "; }
</style>
<!-- ... -->
<p>
    This text needs some footnotes.<span class="footnote">This is a footnote.</span>
</p>

This should yield a result like this:

Footnote illustration
Source

However, the content of the footnote element will be displayed right behind the text it should augment, as if it was a normal span element (the float: footnote; property is being ignored).

This makes it hard to use this library to create PDFs for (ex.) scientific papers (or most other documents where sources for citations are common to be placed in the footnotes section), which I would like to.

@danfickle
Copy link
Owner

Hi @a-leithner,

I think the page features are the strength of this project so I'd definitely like support for float bottom and footnotes. The bad news is that it will probably not be implemented in the near future, as I've still got to fix up the column support before moving onto other layout issues.

@igoratsok
Copy link

igoratsok commented May 24, 2021

Hi @danfickle

This is such an amazing lib that's helping me a lot. Thanks! The only problem for me is: I can't figure out how to make footnotes.
Do you know if from now (May 24, 2021), there's a way to implement footnotes somehow? Thank you so much!

danfickle added a commit that referenced this issue May 26, 2021
danfickle added a commit that referenced this issue May 26, 2021
Still struggling with correct counter-reset behavior.
danfickle added a commit that referenced this issue May 26, 2021
Still needs loads of work but sample is rendering something.
danfickle added a commit that referenced this issue May 29, 2021
Specifically, line boxes that meet with footnotes will now behave somewhat correctly.
@danfickle
Copy link
Owner

I've opened pr #711. Comments welcome.

danfickle added a commit that referenced this issue Jun 4, 2021
danfickle added a commit that referenced this issue Jun 4, 2021
Placement and link destination.
danfickle added a commit that referenced this issue Jun 5, 2021
danfickle added a commit that referenced this issue Jun 5, 2021
We are now using a normal layer rather than painting footnotes separately as that approach did not work when the footnote area went over multiple pages.
danfickle added a commit that referenced this issue Jun 7, 2021
This is to deal with multi-page footnote areas, which are now mostly working. We now reserve entire pages when footnotes flow over multiple pages.
danfickle added a commit that referenced this issue Jun 7, 2021
danfickle added a commit that referenced this issue Jun 10, 2021
Plus:
+ Overhauled BlockBoxing while trying to fix issue. Now better performance and cleaner code.
+ Added benchmarks for BlockBoxing.
danfickle added a commit that referenced this issue Jun 14, 2021
…tes.

Also cleanup and documentation around styling code.
danfickle added a commit that referenced this issue Jun 27, 2021
Table footer is overlapping footnote area.
danfickle added a commit that referenced this issue Jun 27, 2021
danfickle added a commit that referenced this issue Aug 1, 2021
It is sitting above the footnotes.
danfickle added a commit that referenced this issue Aug 1, 2021
danfickle added a commit that referenced this issue Aug 9, 2021
…eracting with footnotes.

Minor fix to prevent anchor element being stripped from footnote calls which are floated.
danfickle added a commit that referenced this issue Aug 19, 2021
With more work on correct boxing, so that images may now be used as footnote calls and footnote markers.
danfickle added a commit that referenced this issue Aug 22, 2021
Since we wrap generated content correctly now, one can use a border on the generated content box (such as before or after) and get Chrome matching results, rather than a border on each item in the content property list.

With test proof:
+ Test for pseudo elements with different display values.
+ Test for using an image as footnote-call.
+ Test for using an image as footnote-marker.
danfickle added a commit that referenced this issue Aug 22, 2021
Tests non-paginated table content works inside footnote body as well as footnotes being called from inside an in-flow table.
Also tests use of before and after pseudo elements in the footnote element.
danfickle added a commit that referenced this issue Aug 22, 2021
Footnotes seem to cause problems with the destination of in-flow targets.
danfickle added a commit that referenced this issue Aug 23, 2021
…ved.

Problem was that when a pending box was added, then removed from a line, it link target was not being removed.

Also some documentation and cleanup.
danfickle added a commit that referenced this issue Aug 25, 2021
By processing them as non-footnote content.
danfickle added a commit that referenced this issue Aug 25, 2021
Footnotes should be display: block, position: static, float: none and non-replaced.

Treat invalid elements as normal content. With test proof.
danfickle added a commit that referenced this issue Aug 25, 2021
Unsupported but does not cause infinite loop, OOM, etc.
danfickle added a commit that referenced this issue Aug 27, 2021
So it picks up orphans and widows. Also proof for footnotes basic test.
danfickle added a commit that referenced this issue Sep 6, 2021
Multi-page output is correct.

Single page output produces footnotes in between content which is nonsensical but we are primarily a paged renderer.
danfickle added a commit that referenced this issue Sep 6, 2021
Fixes #364 - Implement footnotes at bottom of page
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants