-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Markdown footnotes are duplicated #1603
Comments
I confirm the bug. Just to compare: Another markdown processor, multimarkdown, when processing from md to html, generates many references to one footnote. |
It would probably be better to present a uniform solution which works across all output formats. |
I guess to have a uniform solution is never a bad idea, but I'm woundering which format supports footnotes, but not multiple references to one footnote? |
I have no idea to be honest. That might be a good argument to just apply this change to the markdown writer. |
Why the issue is marked as "enhancement"? I would say it is a bug. |
+++ Václav Haisman [Jan 04 16 07:16 ]:
If we did make a change allowing multiple references But one thing to keep in mind is that pandoc supports many |
It seems this issue has a long history and discussion thread I am not aware of. Moreover, I am not experienced in this area, but… mpickering wrote:
I would not agree with this. Output formats differ, and uniform solution may not (or even will not) work for all. For example: HTML output format assumes one (probably long) page. All the footnotes are printed at the very bottom. And having a separate footnote for every link looks ugly. (Backlinks is not a problem, at least conceptually, look at Mediawiki/Wikipedia solution: they have multiple backlinks in a single footnote.) Another output format (TeX?) may assume output document consist of multiple pages, and footnotes are printed at the bottom of page. In such a case, it is natural to print footnote on each page containing a reference. So, internal representation (I am not aware how you call it, probably AST?) should be able to represent multiple links to the same footnote. Each writer (html, tex, etc) should be able to handle it: either generate single footnote or multiple footnotes, depending on output format; no uniform solution is needed. |
Any progress on this whatsoever? |
No progress. It would be a fairly involved change, as noted above, affecting pandoc-types, all readers, and all writers. There are higher-priority things to work on at the moment. |
Just ran into this issue. Would love to see pandoc handle footnotes like this correctly at some point. |
FWIW, the same happens with reStructuredText footnotes. |
…int first authorship notice" This is due to jgm/pandoc#1603 This reverts commit 02487ed.
Is there any plan when that should be fixed? |
Just ran into this as well. Hoping for a fix, even though it sounds non-trivial. |
I am really interested in this issue. I would like to use the same footnote in different places without having it duplicated. @tarleb, I read your advice in #5196 but in my case I am not interested in use the footnotes with references inside, I just want to use as notes and have repeated the same text twice times is very annoying... Is any plan to fix it @jgm? Of course, thanks in advance for your and time! Pandoc is an awesome and very useful tool ❤️ |
The problem is how Thus the cleanest solution would be to change the AST, but that's something we try to do rarely, as it has the potential to break all pandoc filters etc. Btw. there is a proposal that would also change the The alternative would be to somehow de-duplicate the |
@mb21 Currently reader has to match note references to notes, so it has to postpone generation of AST until all notes are collected. It is also the reason for ugly Separating the notes from references will make it possible to shift the function of note reference lookup to writers, where all the notes are already collected. |
Not the only reason. There are also e.g. reference links. Changing this wouldn't remove the need for Future or two-pass. Note also that the proposed AST change would require two passes (or something equivalent) in many of the writers. So I don't think there is any net decrease in complexity. In addition to breaking filters etc., the change would be quite a lot of work, since every reader and writer would have to be modified. That's not to say we shouldn't do it. But I would prioritize better table and figure support over this. |
Note that separating note references and notes in the AST would also allow a fix for #2053...though there may be some complications handling that in some output formats. De-duplicating the notes is not a good solution, since people might want to have multiple notes with the same content (e.g., "Ibid., p. 33"). |
Might be an obvious quickfix, but for Latex a simple |
Reading this issue discussion, kind of made me think that there is a general potential for a structural improvement regarding the AST that would allow for smoother changes. More specifically: Would it be possible to make the required change in the AST, but also have "a function" that then converts the AST into how it would have looked before, and then let the readers define which version of the AST they are/can supply, and let the writers define which version(s) of the AST they support/prefer? |
The problem is that the AST is not only exposed to the readers and writers, but also potentially to haskell programs using pandoc as a library (although a lot of them hopefully use |
what if everything was versioned (including the things you mentioned like filters), and we do backwards compatibility where feasible, and where not implemented, we fail gracefully with a meaningful message like: "Error: Filter abc.py (supporting versions [0.3 - 0.4]) does not support any of the AST versions available ([0.6 - 0.9]) for the current input and output formats."? |
The JSON output does include version information like |
yeah, one can not reduce the work with versioning, but the work that has to be done at once, so to speak... right? |
Does this issue fall under the topic of cross references? |
Any progress on this? |
If you add multiple references to one footnote in Markdown like this:
pandoc will create multiple footnotes instead of referencing only one. For example, if converted into Markdown again, one would end up with:
The same happens when converted to HTML (I didn't try other formats). Obviously, this should not happen but instead it should be one footnote which is just linked to multiple points in the text.
I've tested this locally using version 1.12.3.3 as well as with 1.13.1 at Try pandoc!
The text was updated successfully, but these errors were encountered: