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

Document that Footnote ids should be unique in Quarto Book when producing PDF, EPUB, and DOCX #7894

Closed
IULibScholComm opened this issue Dec 12, 2023 · 4 comments · Fixed by quarto-dev/quarto-web#1411
Assignees
Labels
documentation Doc improvements & quarto-web triaged-to Issues that were not self-assigned, signals that an issue was assigned to someone.
Milestone

Comments

@IULibScholComm
Copy link

Bug description

In the PDF, EPUB, and DOCX, the footnotes of my Chapter 6 (the last chapter with footnotes) of my Quarto book are treated as the footnotes of every other chapter. (I.e. the Chapter 6 footnotes, which run 1-9, replace footnotes 1-9 of the first five chapters.)

Steps to reproduce

# The Ratchet and the Red Queen {#sec-chap6}

May and Anderson concluded that the Red Queen could work, but only if parasites killed their hosts (i.e., they were maximally virulent).[^1]

[^1]: May and Anderson, for example, stated, "Our studies, in which the epidemiological details of the parasite–host interactions are treated more explicitly than in Hamilton's work, make this [the parasite] answer to the problem of sex [@ghiselin1974a; @williams1975a; @maynard1978a] less likely."

Expected behavior

The notes of Chapter 6 should appear only in Chapter 6 in the PDF, EPUB, and DOCX, not as the notes of all the chapters in those formats.

Actual behavior

The notes of Chapter 6 (1-9) appear as the notes (1-9) of every chapter in the PDF, EPUB, and DOCX versions and the notes (1-9) of Chapters 1-5 are erased; notes 10+ of Chapters 1-5, however, are correct.

Your environment

  • IDE: VSCode: 1.85.0
  • OS: Windows 10 Enterprise 22H2

Quarto check output

[>] Checking versions of quarto binary dependencies...
Pandoc version 3.1.9: OK
Dart Sass version 1.69.5: OK
Deno version 1.37.2: OK
[>] Checking versions of quarto dependencies......OK
[>] Checking Quarto installation......OK
Version: 1.4.521
Path: C:\Program Files\Quarto\bin
CodePage: 1252 [>] Checking tools....................OK
TinyTeX: (not installed)
Chromium: (not installed) [>] Checking LaTeX....................OK
Using: Installation From Path
Path: C:\texlive\2023\bin\windows
Version: 2023 [>] Checking basic markdown render....OK [>] Checking Python 3 installation....OK
Version: 3.11.4
Path: C:/Users/amazel/AppData/Local/Programs/Python/Python311/python.exe
Jupyter: 5.5.0
Kernels: ir, python3 [>] Checking Jupyter engine render....OK [>] Checking R installation...........OK
Version: 4.3.0
Path: C:/Users/amazel/AppData/Local/Programs/R/R-4.3.0
LibPaths:

  • C:/Users/amazel/AppData/Local/R/win-library/4.3
  • C:/Users/amazel/AppData/Local/Programs/R/R-4.3.0/library
  • knitr: 1.43
  • rmarkdown: 2.22 [>] Checking Knitr engine render......OK
@IULibScholComm IULibScholComm added the bug Something isn't working label Dec 12, 2023
@cderv
Copy link
Collaborator

cderv commented Dec 13, 2023

This indeed can be reproduced and is related to scoping. We do not mention that in our doc though:
https://quarto.org/docs/authoring/footnotes-and-citations.html#footnotes

Identifier for footnotes must be unique accross all the document as I believe we will render using Pandoc on a single pass.

In your console log there should be a warning of this form

[WARNING] Duplicate note reference '1' at line 69 column 1

It is better to use specific ids for footnotes, or using inline footnote.

We may try to solve this in the future - Pandoc has a --file-scope feature but it could have some undesired side effect in Quarto book context.

@dragonstyle @cscheid can you confirm this is known limitation for single document project like PDF book, docx or EPUB document created from a Quarto Book Project ?

Or do we have already a processing (Lua or Post Process) that should have been taking care of making this right ?

@dragonstyle
Copy link
Collaborator

I am not aware of any post processing that we do to renumber footnotes (nor do I see any from a cursory look). Adding @jjallaire just to confirm that he doesn't recall implementing anything like that.

@jjallaire
Copy link
Collaborator

Yes, this is indeed the intended behavior (but should in fact be more clearly documented!). Note that when using the visual editor we automatically take care of scoped footnote numbering.

@cderv cderv added documentation Doc improvements & quarto-web and removed bug Something isn't working labels Dec 13, 2023
@cderv cderv changed the title Footnote Error in PDF, EPUB, and DOCX of Quarto Book Document that Footnote ids should be unique in Quarto Book when producing PDF, EPUB, and DOCX Dec 13, 2023
@cderv cderv added this to the v1.4 milestone Dec 13, 2023
@cderv cderv added the triaged-to Issues that were not self-assigned, signals that an issue was assigned to someone. label Dec 13, 2023
@IULibScholComm
Copy link
Author

Thank you very much, all! Your troubleshooting and solution fixed my issue. I very much appreciate it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Doc improvements & quarto-web triaged-to Issues that were not self-assigned, signals that an issue was assigned to someone.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants