git.iko.soy/typeable/pandoc
on master help sign in
LaTeX writer: Use `\hyperref[ident]{text}` for internal links.

Previously we used `\href{\#ident}{text}`, which didn't work on all systems. Thanks to Dirk Laurie.

commit9989170df24bab0bcd0d4d928205301a343e2564 authorJohn MacFarlane <fiddlosopher@gmail.com> dateSat 21 Apr 2012, 09:41 (15 years ago) parente6e63d1
1 file changed+4
src/Text/Pandoc/Writers/LaTeX.hs+4
src/Text/Pandoc/Writers/LaTeX.hs+4
@@ -570,6 +570,10 @@ inlineToLaTeX (RawInline "tex" str) = return $ text str
570570inlineToLaTeX (RawInline _ _) = return empty
571571inlineToLaTeX (LineBreak) = return "\\\\"
572572inlineToLaTeX Space = return space
573+inlineToLaTeX (Link txt ('#':ident, _)) = do
574+ contents <- inlineListToLaTeX txt
575+ ident' <- stringToLaTeX False ident
576+ return $ text "\\hyperref" <> brackets (text ident') <> braces contents
573577inlineToLaTeX (Link txt (src, _)) =
574578 case txt of
575579 [Code _ x] | x == src -> -- autolink