Skip to content

Issue with footnote with reference name 1 #195

Closed

Description

@chrisjsewell

For some reason if you use [^1] as a footnote reference, it actually appears as 2 in the final HTML, even if it is the only footnote. To contrast, if you use [^a] it will show correctly as 1.
Its something to do with how docutils stores footnote references, but the solution isn't immediately apparent

Activity

  1. added
    bug
    on Aug 3, 2020
  2. So-Cool commented on Dec 29, 2020

    @So-Cool

    There are a few other issues with footnotes:

    • ids [^0] and [^1] on the same page appear as 2 and 3;
    • ids [^2] and [^0] on the same page appear as 1 and 3;
    • ids [^2] and [^1] on the same page appear as 3 and 4;
    • ids [^2] and [^3] on the same page appear as 1 and 4; and
    • ids [^2] and another one with a number greater than 3 on the same page appear as 1 and 3.
  3. chrisjsewell commented on Dec 29, 2020

    @chrisjsewell
    MemberAuthor

    hey @So-Cool the reference label has no bearing on the actual number shown on the page: they are always numbered in the sequential order they are referenced, i.e [^0] means that you have labelled that footnote as "0", it does not mean that it will have the number 0

    To avoid confusion, I would suggest always using letters for labels, e.g. [^a]

  4. So-Cool commented on Dec 29, 2020

    @So-Cool

    Sure, I just figured that this information may be useful in debugging the issue.

  5. chrisjsewell commented on Dec 29, 2020

    @chrisjsewell
    MemberAuthor

    ok cheers 👍

  6. idnsunset commented on Jan 15, 2021

    @idnsunset

    It would make more sense to use the exact footnote sequential number as its reference number, the current solution is less intuitive and somewhat confusing.

  7. chrisjsewell commented on Jan 16, 2021

    @chrisjsewell
    MemberAuthor

    It would make more sense to use the exact footnote sequential number as its reference number, the current solution is less intuitive and somewhat confusing.

    the documentation though never suggests to use numbers: https://myst-parser.readthedocs.io/en/latest/using/syntax.html#footnotes, and the implementation is based on the standard pandoc implementation: https://pandoc.org/MANUAL.html#footnotes, as it says there:

    These identifiers are used only to correlate the footnote reference with the note itself; in the output, footnotes will be numbered sequentially.

    Using sequential numbers is generally a bad idea, because you then would have to re-number all your footnotes if you ever add an extra footnote in the middle of the text, or restructure your documentation.

    One could consider adding extra syntax to define a specific reference mark, as in LaTeX: \footnote[10]{footnotes working fine}, but even there it is advised against (https://www.overleaf.com/learn/latex/footnotes):

    Adds a footnote using "10" as reference mark. Unless you have a good reason to do this, it's not recommended because the footnote counter is not altered and you may end up with two different footnotes with the same mark.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions