summaryrefslogtreecommitdiffstats
path: root/tests/roots/test-ext-math
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/roots/test-ext-math-compat/conf.py20
-rw-r--r--tests/roots/test-ext-math-compat/index.rst21
-rw-r--r--tests/roots/test-ext-math-simple/conf.py0
-rw-r--r--tests/roots/test-ext-math-simple/index.rst4
-rw-r--r--tests/roots/test-ext-math/conf.py0
-rw-r--r--tests/roots/test-ext-math/index.rst25
-rw-r--r--tests/roots/test-ext-math/math.rst31
-rw-r--r--tests/roots/test-ext-math/nomath.rst0
-rw-r--r--tests/roots/test-ext-math/page.rst9
9 files changed, 110 insertions, 0 deletions
diff --git a/tests/roots/test-ext-math-compat/conf.py b/tests/roots/test-ext-math-compat/conf.py
new file mode 100644
index 0000000..85e3950
--- /dev/null
+++ b/tests/roots/test-ext-math-compat/conf.py
@@ -0,0 +1,20 @@
+from docutils import nodes
+from docutils.parsers.rst import Directive
+
+extensions = ['sphinx.ext.mathjax']
+
+
+def my_math_role(role, rawtext, text, lineno, inliner, options={}, content=[]):
+ text = 'E = mc^2'
+ return [nodes.math(text, text)], []
+
+
+class MyMathDirective(Directive):
+ def run(self):
+ text = 'E = mc^2'
+ return [nodes.math_block(text, text)]
+
+
+def setup(app):
+ app.add_role('my_math', my_math_role)
+ app.add_directive('my-math', MyMathDirective)
diff --git a/tests/roots/test-ext-math-compat/index.rst b/tests/roots/test-ext-math-compat/index.rst
new file mode 100644
index 0000000..208878c
--- /dev/null
+++ b/tests/roots/test-ext-math-compat/index.rst
@@ -0,0 +1,21 @@
+Test Math
+=========
+
+inline
+------
+
+Inline: :math:`E=mc^2`
+Inline my math: :my_math:`:-)`
+
+block
+-----
+
+.. math:: a^2+b^2=c^2
+
+Second math
+
+.. math:: e^{i\pi}+1=0
+
+Multi math equations
+
+.. my-math::
diff --git a/tests/roots/test-ext-math-simple/conf.py b/tests/roots/test-ext-math-simple/conf.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/roots/test-ext-math-simple/conf.py
diff --git a/tests/roots/test-ext-math-simple/index.rst b/tests/roots/test-ext-math-simple/index.rst
new file mode 100644
index 0000000..a455d89
--- /dev/null
+++ b/tests/roots/test-ext-math-simple/index.rst
@@ -0,0 +1,4 @@
+Test Math
+=========
+
+.. math:: a^2+b^2=c^2
diff --git a/tests/roots/test-ext-math/conf.py b/tests/roots/test-ext-math/conf.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/roots/test-ext-math/conf.py
diff --git a/tests/roots/test-ext-math/index.rst b/tests/roots/test-ext-math/index.rst
new file mode 100644
index 0000000..221284a
--- /dev/null
+++ b/tests/roots/test-ext-math/index.rst
@@ -0,0 +1,25 @@
+Test Math
+=========
+
+.. toctree::
+ :numbered: 1
+
+ math
+ page
+ nomath
+
+.. math:: a^2+b^2=c^2
+
+Inline :math:`E=mc^2`
+
+Second math
+
+.. math:: e^{i\pi}+1=0
+
+Multi math equations
+
+.. math::
+
+ S &= \pi r^2
+
+ V &= \frac{4}{3} \pi r^3
diff --git a/tests/roots/test-ext-math/math.rst b/tests/roots/test-ext-math/math.rst
new file mode 100644
index 0000000..c05c3a0
--- /dev/null
+++ b/tests/roots/test-ext-math/math.rst
@@ -0,0 +1,31 @@
+Test math extensions :math:`E = m c^2`
+======================================
+
+This is inline math: :math:`a^2 + b^2 = c^2`.
+
+.. math:: a^2 + b^2 = c^2
+
+.. math::
+
+ a + 1 < b
+
+.. math::
+ :label: foo
+
+ e^{i\pi} = 1
+
+.. math::
+ :label:
+
+ e^{ix} = \cos x + i\sin x
+
+.. math::
+
+ n \in \mathbb N
+
+.. math::
+ :nowrap:
+
+ a + 1 < b
+
+Referencing equation :eq:`foo` and :math:numref:`foo`.
diff --git a/tests/roots/test-ext-math/nomath.rst b/tests/roots/test-ext-math/nomath.rst
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/roots/test-ext-math/nomath.rst
diff --git a/tests/roots/test-ext-math/page.rst b/tests/roots/test-ext-math/page.rst
new file mode 100644
index 0000000..ef80409
--- /dev/null
+++ b/tests/roots/test-ext-math/page.rst
@@ -0,0 +1,9 @@
+Test multiple pages
+===================
+
+.. math::
+ :label: bar
+
+ a = b + 1
+
+Referencing equations :eq:`foo` and :eq:`bar`.