Files
John MacFarlane 3c56088b4e LaTeX reader: support \footnotemark and \footnotetext (#11450).
These commands allow separating the footnote mark from its content,
useful in tables, minipages, and other contexts where \footnote
cannot be used directly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Closes #11450.
2026-02-14 14:22:15 +00:00

1.1 KiB

Test for \footnotemark and \footnotetext (issue #11450)

% pandoc -f latex -t native
Text\footnotemark{}.
\footnotetext{The footnote content.}
^D
[ Para
    [ Str "Text"
    , Note
        [ Para
            [ Str "The"
            , Space
            , Str "footnote"
            , Space
            , Str "content."
            ]
        ]
    , Str "."
    ]
]

With explicit footnote numbers:

% pandoc -f latex -t native
First\footnotemark[1] and second\footnotemark[2].
\footnotetext[1]{First note.}
\footnotetext[2]{Second note.}
^D
[ Para
    [ Str "First"
    , Note [ Para [ Str "First" , Space , Str "note." ] ]
    , Space
    , Str "and"
    , Space
    , Str "second"
    , Note [ Para [ Str "Second" , Space , Str "note." ] ]
    , Str "."
    ]
]

Mixed with regular footnotes:

% pandoc -f latex -t native
Text\footnotemark[1] and more\footnote{Regular footnote.}
\footnotetext[1]{Marked footnote.}
^D
[ Para
    [ Str "Text"
    , Note [ Para [ Str "Marked" , Space , Str "footnote." ] ]
    , Space
    , Str "and"
    , Space
    , Str "more"
    , Note [ Para [ Str "Regular" , Space , Str "footnote." ] ]
    ]
]