git.iko.soy/typeable/pandoc
on master help sign in
LaTeX writer: Add a `\label` in `\hyperdef` for Div, Span.

Otherwise links don't work.

commit8a77eb4c9c4a280debc067f632f9210bc8cbb5eb authorJohn MacFarlane <jgm@berkeley.edu> dateSat 2 May 2015, 17:58 (11 years ago) parent8245d67
1 file changed+4−2
src/Text/Pandoc/Writers/LaTeX.hs+4−2
src/Text/Pandoc/Writers/LaTeX.hs+4−2
@@ -313,7 +313,8 @@ blockToLaTeX (Div (identifier,classes,_) bs) = do
313313 ref <- toLabel identifier
314314 let linkAnchor = if null identifier
315315 then empty
316− else "\\hyperdef{}" <> braces (text ref) <> "{}"
316+ else "\\hyperdef{}" <> braces (text ref) <>
317+ braces ("\\label" <> braces (text ref))
317318 contents <- blockListToLaTeX bs
318319 if beamer && "notes" `elem` classes -- speaker notes
319320 then return $ "\\note" <> braces contents
@@ -718,7 +719,8 @@ inlineToLaTeX (Span (id',classes,_) ils) = do
718719 ref <- toLabel id'
719720 let linkAnchor = if null id'
720721 then empty
721− else "\\hyperdef{}" <> braces (text ref) <> "{}"
722+ else "\\hyperdef{}" <> braces (text ref) <>
723+ braces ("\\label" <> braces (text ref))
722724 fmap (linkAnchor <>)
723725 ((if noEmph then inCmd "textup" else id) .
724726 (if noStrong then inCmd "textnormal" else id) .