@@ -313,7 +313,7 @@ blockToLaTeX (BlockQuote lst) = do
313313 _ -> do
314314 contents <- blockListToLaTeX lst
315315 return $ "\\begin{quote}" $$ contents $$ "\\end{quote}"
316−blockToLaTeX (CodeBlock (_,classes,keyvalAttr) str) = do
316+blockToLaTeX (CodeBlock (identifier,classes,keyvalAttr) str) = do
317317 opts <- gets stOptions
318318 case () of
319319 _ | isEnabled Ext_literate_haskell opts && "haskell" `elem` classes &&
@@ -344,7 +344,11 @@ blockToLaTeX (CodeBlock (_,classes,keyvalAttr) str) = do
344344 [ (if key == "startFrom"
345345 then "firstnumber"
346346 else key) ++ "=" ++ attr |
347− (key,attr) <- keyvalAttr ]
347+ (key,attr) <- keyvalAttr ] ++
348+ (if identifier == ""
349+ then []
350+ else [ "label=" ++ identifier ])
351+
348352 else []
349353 printParams
350354 | null params = empty