@@ -308,12 +308,11 @@ blockToLaTeX (Div (identifier,classes,_) bs) = do
308 ref <- toLabel identifier
308 ref <- toLabel identifier
309 let linkAnchor = if null identifier
309 let linkAnchor = if null identifier
310 then empty
310 then empty
311− else "\\hyperdef{}" <> braces (text ref) <>
311+ else "\\hyperdef{}" <> braces (text ref)
312− braces ("\\label" <> braces (text ref))
313 contents <- blockListToLaTeX bs
312 contents <- blockListToLaTeX bs
314 if beamer && "notes" `elem` classes -- speaker notes
313 if beamer && "notes" `elem` classes -- speaker notes
315 then return $ "\\note" <> braces contents
314 then return $ "\\note" <> braces contents
316− else return (linkAnchor <> contents)
315+ else return (linkAnchor $$ contents)
317blockToLaTeX (Plain lst) =
316blockToLaTeX (Plain lst) =
318 inlineListToLaTeX $ dropWhile isLineBreakOrSpace lst
317 inlineListToLaTeX $ dropWhile isLineBreakOrSpace lst
319-- title beginning with fig: indicates that the image is a figure
318-- title beginning with fig: indicates that the image is a figure
@@ -670,11 +669,11 @@ inlineToLaTeX (Span (id',classes,_) ils) = do
670 let noEmph = "csl-no-emph" `elem` classes
669 let noEmph = "csl-no-emph" `elem` classes
671 let noStrong = "csl-no-strong" `elem` classes
670 let noStrong = "csl-no-strong" `elem` classes
672 let noSmallCaps = "csl-no-smallcaps" `elem` classes
671 let noSmallCaps = "csl-no-smallcaps" `elem` classes
673− label' <- if null id'
673+ let linkAnchor = if null id'
674− then return empty
674+ then empty
675− else toLabel id' >>= \x ->
675+ else "\\hyperdef{}" <> braces (text ref)
676− return (text "\\label" <> braces (text x))
676+ fmap (linkAnchor <>)
678 ((if noEmph then inCmd "textup" else id) .
677 ((if noEmph then inCmd "textup" else id) .
679 (if noStrong then inCmd "textnormal" else id) .
678 (if noStrong then inCmd "textnormal" else id) .
680 (if noSmallCaps then inCmd "textnormal" else id) .
679 (if noSmallCaps then inCmd "textnormal" else id) .