@@ -309,7 +309,7 @@ blockToLaTeX (BlockQuote lst) = do
309309 _ -> do
310310 contents <- blockListToLaTeX lst
311311 return $ "\\begin{quote}" $$ contents $$ "\\end{quote}"
312−blockToLaTeX (CodeBlock (_,classes,keyvalAttr) str) = do
312+blockToLaTeX (CodeBlock (identifier,classes,keyvalAttr) str) = do
313313 opts <- gets stOptions
314314 case () of
315315 _ | isEnabled Ext_literate_haskell opts && "haskell" `elem` classes &&
@@ -340,7 +340,11 @@ blockToLaTeX (CodeBlock (_,classes,keyvalAttr) str) = do
340340 [ (if key == "startFrom"
341341 then "firstnumber"
342342 else key) ++ "=" ++ attr |
343− (key,attr) <- keyvalAttr ]
343+ (key,attr) <- keyvalAttr ] ++
344+ (if identifier == ""
345+ then []
346+ else [ "label=" ++ identifier ])
347+
344348 else []
345349 printParams
346350 | null params = empty