aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2012-04-21 09:41:05 -0700
committerJohn MacFarlane <fiddlosopher@gmail.com>2012-04-21 09:41:05 -0700
commit9989170df24bab0bcd0d4d928205301a343e2564 (patch)
tree946dbba67f4020c8fd9e20ffcb69b81729d9c893
parente6e63d16997322295f098470b85c4756b54d54f0 (diff)
downloadpandoc-9989170df24bab0bcd0d4d928205301a343e2564.tar.gz
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.
-rw-r--r--src/Text/Pandoc/Writers/LaTeX.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs
index 3bef597dc..c4ded57c5 100644
--- a/src/Text/Pandoc/Writers/LaTeX.hs
+++ b/src/Text/Pandoc/Writers/LaTeX.hs
@@ -570,6 +570,10 @@ inlineToLaTeX (RawInline "tex" str) = return $ text str
inlineToLaTeX (RawInline _ _) = return empty
inlineToLaTeX (LineBreak) = return "\\\\"
inlineToLaTeX Space = return space
+inlineToLaTeX (Link txt ('#':ident, _)) = do
+ contents <- inlineListToLaTeX txt
+ ident' <- stringToLaTeX False ident
+ return $ text "\\hyperref" <> brackets (text ident') <> braces contents
inlineToLaTeX (Link txt (src, _)) =
case txt of
[Code _ x] | x == src -> -- autolink