aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2011-12-31 11:40:47 -0800
committerJohn MacFarlane <fiddlosopher@gmail.com>2011-12-31 11:40:47 -0800
commit3cf60c73061f247b531da4b3c18664c6134bee53 (patch)
tree55cded45b8b5503ff8fadfe91f0e6807a06ac9de /tests
parentc264dc4f5b86688552f663f1487d135b035f0b62 (diff)
downloadpandoc-3cf60c73061f247b531da4b3c18664c6134bee53.tar.gz
Support for math in RST reader and writer.
Inline math uses the :math:`...` construct. Display math uses .. math:: ... or if multilin .. math:: ... These seem to be supported now by rst2latex.py.
Diffstat (limited to 'tests')
-rw-r--r--tests/rst-reader.native9
-rw-r--r--tests/rst-reader.rst29
-rw-r--r--tests/writer.rst17
3 files changed, 46 insertions, 9 deletions
diff --git a/tests/rst-reader.native b/tests/rst-reader.native
index 612db85bd..8d273a1d7 100644
--- a/tests/rst-reader.native
+++ b/tests/rst-reader.native
@@ -305,4 +305,11 @@ Pandoc (Meta {docTitle = [Str "Pandoc",Space,Str "Test",Space,Str "Suite",Str ":
,Para [Note [Para [Str "Note",Space,Str "with",Space,Str "continuation",Space,Str "line",Str "."]]]
,Para [Note [Para [Str "Note",Space,Str "with"],Para [Str "continuation",Space,Str "block",Str "."]]]
,Para [Note [Para [Str "Note",Space,Str "with",Space,Str "continuation",Space,Str "line"],Para [Str "and",Space,Str "a",Space,Str "second",Space,Str "para",Str "."]]]
-,Para [Str "Not",Space,Str "in",Space,Str "note",Str "."]]
+,Para [Str "Not",Space,Str "in",Space,Str "note",Str "."]
+,Header 1 [Str "Math"]
+,Para [Str "Some",Space,Str "inline",Space,Str "math",Space,Math InlineMath "E=mc^2",Str ".",Space,Str "Now",Space,Str "some",Space,Str "display",Space,Str "math",Str ":"]
+,Para [Math DisplayMath "E=mc^2"]
+,Para [Math DisplayMath "E = mc^2"]
+,Para [Math DisplayMath "E = mc^2",Math DisplayMath "\\alpha = \\beta"]
+,Para [Math DisplayMath "E &= mc^2\\\\\nF &= \\pi E",Math DisplayMath "F &= \\gamma \\alpha^2"]
+,Para [Str "All",Space,Str "done",Str "."]]
diff --git a/tests/rst-reader.rst b/tests/rst-reader.rst
index 519f0080c..cfebd2054 100644
--- a/tests/rst-reader.rst
+++ b/tests/rst-reader.rst
@@ -536,3 +536,32 @@ Footnotes
Not in note.
+Math
+====
+
+Some inline math :math:`E=mc^2`\ . Now some
+display math:
+
+.. math:: E=mc^2
+
+.. math::
+
+ E = mc^2
+
+.. math::
+
+ E = mc^2
+
+ \alpha = \beta
+
+.. math::
+ :label hithere
+ :nowrap
+
+ E &= mc^2\\
+ F &= \pi E
+
+ F &= \gamma \alpha^2
+
+All done.
+
diff --git a/tests/writer.rst b/tests/writer.rst
index 654c924a5..09fd8dcb3 100644
--- a/tests/writer.rst
+++ b/tests/writer.rst
@@ -598,15 +598,16 @@ LaTeX
=====
-
-- :math:`$2+2=4$`
-- :math:`$x \in y$`
-- :math:`$\alpha \wedge \omega$`
-- :math:`$223$`
-- :math:`$p$`-Tree
+- :math:`2+2=4`
+- :math:`x \in y`
+- :math:`\alpha \wedge \omega`
+- :math:`223`
+- :math:`p`\ -Tree
- Here’s some display math:
- :math:`$$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$$`
-- Here’s one that has a line break in it:
- :math:`$\alpha + \omega \times x^2$`.
+
+ .. math:: \frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}
+
+- Here’s one that has a line break in it: :math:`\alpha + \omega \times x^2`\ .
These shouldn’t be math: