From 1d53d452c3a2ac81bcf9bd40f31c40a0656706a2 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 28 Oct 2015 09:37:05 -0700 Subject: LaTeX writer: add `\protect` to `\hyperlink`. Thanks to Hadrien Mary for the problem and solution. Closes #2490. --- src/Text/Pandoc/Writers/LaTeX.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Text/Pandoc') diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs index 9b345fcfe..7cbfce950 100644 --- a/src/Text/Pandoc/Writers/LaTeX.hs +++ b/src/Text/Pandoc/Writers/LaTeX.hs @@ -881,7 +881,7 @@ inlineToLaTeX Space = return space inlineToLaTeX (Link txt ('#':ident, _)) = do contents <- inlineListToLaTeX txt lab <- toLabel ident - return $ text "\\hyperlink" <> braces (text lab) <> braces contents + return $ text "\\protect\\hyperlink" <> braces (text lab) <> braces contents inlineToLaTeX (Link txt (src, _)) = case txt of [Str x] | escapeURI x == src -> -- autolink -- cgit v1.2.3