git.iko.soy/typeable/pandoc
on master help sign in
Org reader: set documentclass meta from LaTeX_class
825ce8cAlbert Krewinkel
src/Text/Pandoc/Readers/Org/Meta.hs+1
@@ -77,6 +77,7 @@ metaValue key =
77 "header-includes" -> (key,) <$> accumulatingList key metaInlines
77 "header-includes" -> (key,) <$> accumulatingList key metaInlines
78 "latex_header" -> (inclKey,) <$>
78 "latex_header" -> (inclKey,) <$>
79 accumulatingList inclKey (metaExportSnippet "latex")
79 accumulatingList inclKey (metaExportSnippet "latex")
80+ "latex_class" -> ("documentclass",) <$> metaString
80 _ -> (key,) <$> metaString
81 _ -> (key,) <$> metaString
81
82
82metaInlines :: OrgParser (F MetaValue)
83metaInlines :: OrgParser (F MetaValue)
tests/Tests/Readers/Org.hs+5
@@ -503,6 +503,11 @@ tests =
503 meta = setMeta "header-includes" inclList nullMeta
503 meta = setMeta "header-includes" inclList nullMeta
504 in Pandoc meta mempty
504 in Pandoc meta mempty
505
505
506+ , "LaTeX_class option is translated to documentclass" =:
507+ "#+LATEX_CLASS: article" =?>
508+ let meta = setMeta "documentclass" (MetaString "article") nullMeta
509+ in Pandoc meta mempty
510+
506 , "later meta definitions take precedence" =:
511 , "later meta definitions take precedence" =:
507 unlines [ "#+AUTHOR: this will not be used"
512 unlines [ "#+AUTHOR: this will not be used"
508 , "#+author: Max"
513 , "#+author: Max"