Skip to content

Implement footnotes for LaTeX output #314

Open
r-lib/commonmark
#32
@yihui

Description

@yihui

Currently LaTeX output for footnotes is not implemented:

cmark-gfm/src/latex.c

Lines 447 to 449 in c32ef78

case CMARK_NODE_FOOTNOTE_DEFINITION:
case CMARK_NODE_FOOTNOTE_REFERENCE:
// TODO

I don't have much expertise on C but I wonder if the team is interested in getting it implemented. Basically what we need to do is to add the footnote content to \footnote{} in the case of CMARK_NODE_FOOTNOTE_REFERENCE, and output nil in the case of CMARK_NODE_FOOTNOTE_DEFINITION .

  case CMARK_NODE_FOOTNOTE_DEFINITION:
    break;
  case CMARK_NODE_FOOTNOTE_REFERENCE:
    if (entering) {
      LIT("\\footnote{");
      // How can I get the footnote content here?
    } else {
      LIT("}");
    }
    break;

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions