From ab8c0dcd410282baaa9429f755ad55e6d01a2466 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 16 Aug 2013 12:40:38 -0700 Subject: LaTeX reader: parse label after section command and set id. Closes #951. --- src/Text/Pandoc/Readers/LaTeX.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/Text') diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index 414e50fc8..50a95c361 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -315,12 +315,14 @@ authors = try $ do addMeta "authors" (map trimInlines auths) section :: Attr -> Int -> LP Blocks -section attr lvl = do +section (ident, classes, kvs) lvl = do hasChapters <- stateHasChapters `fmap` getState let lvl' = if hasChapters then lvl + 1 else lvl skipopts contents <- grouped inline - return $ headerWith attr lvl' contents + lab <- option ident $ try $ spaces >> controlSeq "label" >> + spaces >> braced + return $ headerWith (lab, classes, kvs) lvl' contents inlineCommand :: LP Inlines inlineCommand = try $ do -- cgit v1.2.3