@@ -108,42 +108,62 @@ tests =
108108 meta = setMeta "keywords" (MetaInlines keywords) nullMeta
109109 in Pandoc meta mempty
110110
111− , "LaTeX_headers options are translated to header-includes" =:
112− "#+LaTeX_header: \\usepackage{tikz}" =?>
113− let latexInlines = rawInline "latex" "\\usepackage{tikz}"
114− inclList = MetaList [MetaInlines (toList latexInlines)]
115− meta = setMeta "header-includes" inclList nullMeta
116− in Pandoc meta mempty
111+ , "Institute" =:
112+ "#+INSTITUTE: ACME Inc." =?>
113+ Pandoc (setMeta "institute" ("ACME Inc." :: Inlines) nullMeta) mempty
117114
118− , testGroup "LaTeX_CLASS"
119− [ "LaTeX_class option is translated to documentclass" =:
120− "#+LATEX_CLASS: article" =?>
121− let meta = setMeta "documentclass" (MetaString "article") nullMeta
115+ , testGroup "LaTeX"
116+ [ "LaTeX_headers options are translated to header-includes" =:
117+ "#+LaTeX_header: \\usepackage{tikz}" =?>
118+ let latexInlines = rawInline "latex" "\\usepackage{tikz}"
119+ inclList = MetaList [MetaInlines (toList latexInlines)]
120+ meta = setMeta "header-includes" inclList nullMeta
122121 in Pandoc meta mempty
123122
124− , "last definition takes precedence" =:
125− T.unlines [ "#+LATEX_CLASS: this will not be used"
126− , "#+LATEX_CLASS: report"
127− ] =?>
128− let meta = setMeta "documentclass" (MetaString "report") nullMeta
123+ , "LATEX_HEADER_EXTRA values are translated to header-includes" =:
124+ "#+LATEX_HEADER_EXTRA: \\usepackage{calc}" =?>
125+ let latexInlines = rawInline "latex" "\\usepackage{calc}"
126+ inclList = toMetaValue [latexInlines]
127+ in Pandoc (setMeta "header-includes" inclList nullMeta) mempty
128+
129+ , testGroup "LaTeX_CLASS"
130+ [ "LaTeX_class option is translated to documentclass" =:
131+ "#+LATEX_CLASS: article" =?>
132+ let meta = setMeta "documentclass" (MetaString "article") nullMeta
133+ in Pandoc meta mempty
134+
135+ , "last definition takes precedence" =:
136+ T.unlines [ "#+LATEX_CLASS: this will not be used"
137+ , "#+LATEX_CLASS: report"
138+ ] =?>
139+ let meta = setMeta "documentclass" (MetaString "report") nullMeta
140+ in Pandoc meta mempty
141+ ]
142+
143+ , "LaTeX_class_options is translated to classoption" =:
144+ "#+LATEX_CLASS_OPTIONS: [a4paper]" =?>
145+ let meta = setMeta "classoption" (MetaString "a4paper") nullMeta
129146 in Pandoc meta mempty
130147 ]
131148
132− , "LaTeX_class_options is translated to classoption" =:
133− "#+LATEX_CLASS_OPTIONS: [a4paper]" =?>
134− let meta = setMeta "classoption" (MetaString "a4paper") nullMeta
135− in Pandoc meta mempty
136−
137− , "LaTeX_class_options is translated to classoption" =:
138− "#+html_head: <meta/>" =?>
139− let html = rawInline "html" "<meta/>"
140− inclList = MetaList [MetaInlines (toList html)]
141− meta = setMeta "header-includes" inclList nullMeta
142− in Pandoc meta mempty
149+ , testGroup "HTML"
150+ [ "HTML_HEAD values are added to header-includes" =:
151+ "#+html_head: <meta/>" =?>
152+ let html = rawInline "html" "<meta/>"
153+ inclList = MetaList [MetaInlines (toList html)]
154+ meta = setMeta "header-includes" inclList nullMeta
155+ in Pandoc meta mempty
143156
144− , "Institute" =:
145− "#+INSTITUTE: ACME Inc." =?>
146− Pandoc (setMeta "institute" ("ACME Inc." :: Inlines) nullMeta) mempty
157+ , "HTML_HEAD_EXTRA behaves like HTML_HEAD" =:
158+ T.unlines [ "#+HTML_HEAD: <meta name=\"generator\" content=\"pandoc\">"
159+ , "#+HTML_HEAD_EXTRA: <meta charset=\"utf-8\">"
160+ ] =?>
161+ let generator = rawInline "html"
162+ "<meta name=\"generator\" content=\"pandoc\">"
163+ charset = rawInline "html" "<meta charset=\"utf-8\">"
164+ inclList = toMetaValue [generator, charset]
165+ in Pandoc (setMeta "header-includes" inclList nullMeta) mempty
166+ ]
147167 ]
148168
149169 , "Properties drawer" =: