@@ -655,16 +655,20 @@ isQuoted _ = False
655655-- | Convert inline element to LaTeX
656656inlineToLaTeX :: Inline -- ^ Inline to convert
657657 -> State WriterState Doc
658−inlineToLaTeX (Span (_,classes,_) ils) = do
658+inlineToLaTeX (Span (id',classes,_) ils) = do
659659 let noEmph = "csl-no-emph" `elem` classes
660660 let noStrong = "csl-no-strong" `elem` classes
661661 let noSmallCaps = "csl-no-smallcaps" `elem` classes
662− ((if noEmph then inCmd "textup" else id) .
663− (if noStrong then inCmd "textnormal" else id) .
664− (if noSmallCaps then inCmd "textnormal" else id) .
665− (if not (noEmph || noStrong || noSmallCaps)
666− then braces
667− else id)) `fmap` inlineListToLaTeX ils
662+ let label' = if (null id')
663+ then empty
664+ else text "\\label" <> braces (text $ toLabel id')
665+ fmap (label' <>)
666+ ((if noEmph then inCmd "textup" else id) .
667+ (if noStrong then inCmd "textnormal" else id) .
668+ (if noSmallCaps then inCmd "textnormal" else id) .
669+ (if not (noEmph || noStrong || noSmallCaps)
670+ then braces
671+ else id)) `fmap` inlineListToLaTeX ils
668672inlineToLaTeX (Emph lst) =
669673 inlineListToLaTeX lst >>= return . inCmd "emph"
670674inlineToLaTeX (Strong lst) =