From ff12c20f20067c55f8f55bb66e710b1d8910ad3a Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Tue, 9 Sep 2025 08:47:56 +0200 Subject: LaTeX writer: Don't add links to TOC. Fixes: #11124 --- src/Text/Pandoc/Writers/LaTeX.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs index a2175b0d1..eb4671c18 100644 --- a/src/Text/Pandoc/Writers/LaTeX.hs +++ b/src/Text/Pandoc/Writers/LaTeX.hs @@ -785,6 +785,7 @@ sectionHeader classes ident level lst = do removeInvalidInline x = [x] let lstNoNotes = foldr (mappend . (\x -> walkM removeInvalidInline x)) mempty lst txtNoNotes <- inlineListToLaTeX lstNoNotes + txtNoLinksNoNotes <- inlineListToLaTeX (removeLinks lstNoNotes) -- footnotes in sections don't work (except for starred variants) -- unless you specify an optional argument: -- \section[mysec]{mysec\footnote{blah}} @@ -837,7 +838,7 @@ sectionHeader classes ident level lst = do $$ if unnumbered && not unlisted then "\\addcontentsline{toc}" <> braces (text sectionType) <> - braces txtNoNotes + braces txtNoLinksNoNotes else empty -- | Convert list of inline elements to LaTeX. -- cgit v1.2.3