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

Implement LaTeX footnotes using \footnotemark and \footnotetext #32

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

yihui
Copy link
Contributor

@yihui yihui commented Oct 11, 2024

This is the best I could achieve with my poor knowledge of C. Ideally, we should render footnotes into \footnote{} in the case of CMARK_NODE_FOOTNOTE_REFERENCE, but I can't figure out how I can get the footnote content from the node there (maybe that's just not possible). I'd very much appreciate help here.

Fixes github/cmark-gfm#314

@jeroen
Copy link
Member

jeroen commented Oct 14, 2024

This is the best I could achieve with my poor knowledge of C. Ideally, we should render footnotes into \footnote{} in the case of CMARK_NODE_FOOTNOTE_REFERENCE, but I can't figure out how I can get the footnote content from the node there (maybe that's just not possible). I'd very much appreciate help here.

Could you give some example markdown input with the intended output (to match pandoc or similar), perhaps I can help.

@yihui
Copy link
Contributor Author

yihui commented Oct 14, 2024

Sure:

Hello[^1]

[^1]: A footnote.

should generate

Hello\footnote{A footnote.}

Currently I'm generating

Hello\footnotemark[1]

\footnotetext[1]{A footnote.}

which is fine but not ideal.

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 this pull request may close these issues.

Implement footnotes for LaTeX output
2 participants