LaTeX writer: Add a \label in \hyperdef for Div, Span.

Otherwise links don't work.
This commit is contained in:
John MacFarlane 2015-05-02 17:58:16 -07:00
parent 8245d672bd
commit 8a77eb4c9c

View file

@ -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) .