Skip to content

Commit

Permalink
use \footnotetext and \footnotemark to implement LaTeX footnotes
Browse files Browse the repository at this point in the history
  • Loading branch information
yihui committed Oct 11, 2024
1 parent be62b2b commit c3be50e
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/cmark/latex.c
Original file line number Diff line number Diff line change
Expand Up @@ -447,8 +447,20 @@ static int S_render_node(cmark_renderer *renderer, cmark_node *node,
break;

case CMARK_NODE_FOOTNOTE_DEFINITION:
if (entering) {
LIT("\\footnotetext[");
OUT(cmark_chunk_to_cstr(renderer->mem, &node->as.literal), false, LITERAL);
LIT("]{");
} else {
LIT("}");
}
break;
case CMARK_NODE_FOOTNOTE_REFERENCE:
// TODO
if (entering) {
LIT("\\footnotemark[");
OUT(cmark_chunk_to_cstr(renderer->mem, &node->parent_footnote_def->as.literal), false, LITERAL);
LIT("]");
}
break;

default:
Expand Down

0 comments on commit c3be50e

Please sign in to comment.