diff options
| author | John MacFarlane <fiddlosopher@gmail.com> | 2013-08-16 12:40:38 -0700 | 
|---|---|---|
| committer | John MacFarlane <fiddlosopher@gmail.com> | 2013-08-16 12:40:38 -0700 | 
| commit | ab8c0dcd410282baaa9429f755ad55e6d01a2466 (patch) | |
| tree | 662277e9a727d32c740318ab3500087a4dd9454a | |
| parent | 309024971c1f4cfea0dc2529cc4b75f02d7def33 (diff) | |
| download | pandoc-ab8c0dcd410282baaa9429f755ad55e6d01a2466.tar.gz | |
LaTeX reader:  parse label after section command and set id.
Closes #951.
| -rw-r--r-- | src/Text/Pandoc/Readers/LaTeX.hs | 6 | 
1 files changed, 4 insertions, 2 deletions
| 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 | 
