aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-05-02 17:58:16 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2015-05-02 17:58:16 -0700
commit8a77eb4c9c4a280debc067f632f9210bc8cbb5eb (patch)
tree8c36bc3ac81381dbe9884ba7a50330c48f5cd6d5 /src/Text/Pandoc
parent8245d672bde6e255ded1b9bdc3ce540c046b24f1 (diff)
downloadpandoc-8a77eb4c9c4a280debc067f632f9210bc8cbb5eb.tar.gz
LaTeX writer: Add a `\label` in `\hyperdef` for Div, Span.
Otherwise links don't work.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Writers/LaTeX.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs
index d7b6cde83..70280aaec 100644
--- a/src/Text/Pandoc/Writers/LaTeX.hs
+++ b/src/Text/Pandoc/Writers/LaTeX.hs
@@ -313,7 +313,8 @@ blockToLaTeX (Div (identifier,classes,_) bs) = do
ref <- toLabel identifier
let linkAnchor = if null identifier
then empty
- else "\\hyperdef{}" <> braces (text ref) <> "{}"
+ else "\\hyperdef{}" <> braces (text ref) <>
+ braces ("\\label" <> braces (text ref))
contents <- blockListToLaTeX bs
if beamer && "notes" `elem` classes -- speaker notes
then return $ "\\note" <> braces contents
@@ -718,7 +719,8 @@ inlineToLaTeX (Span (id',classes,_) ils) = do
ref <- toLabel id'
let linkAnchor = if null id'
then empty
- else "\\hyperdef{}" <> braces (text ref) <> "{}"
+ else "\\hyperdef{}" <> braces (text ref) <>
+ braces ("\\label" <> braces (text ref))
fmap (linkAnchor <>)
((if noEmph then inCmd "textup" else id) .
(if noStrong then inCmd "textnormal" else id) .