mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Test suite update for math extension.
This commit is contained in:
parent
26d724cb6d
commit
6d89feae1e
@ -63,7 +63,7 @@ further translation is necessary when building LaTeX output.
|
||||
to be issued. See :role:`eqref` for an example. The numbering style depends
|
||||
on the output format.
|
||||
|
||||
.. role:: eqref
|
||||
.. role:: eq
|
||||
|
||||
Role for cross-referencing equations via their label. This currently works
|
||||
only within the same document. Example::
|
||||
@ -71,7 +71,7 @@ further translation is necessary when building LaTeX output.
|
||||
.. math:: e^{i\pi} + 1 = 0
|
||||
:label: euler
|
||||
|
||||
Euler's identity, equation :eqref:`euler`, was elected one of the most
|
||||
Euler's identity, equation :eq:`euler`, was elected one of the most
|
||||
beautiful mathematical formulas.
|
||||
|
||||
|
||||
|
@ -67,8 +67,8 @@ def latex_visit_math(self, node):
|
||||
raise nodes.SkipNode
|
||||
|
||||
def latex_visit_displaymath(self, node):
|
||||
self.body.append(wrap_displaymath(node['latex'],
|
||||
node['docname'] + '-' + node['label']))
|
||||
label = node['label'] and node['docname'] + '-' + node['label'] or None
|
||||
self.body.append(wrap_displaymath(node['latex'], label))
|
||||
raise nodes.SkipNode
|
||||
|
||||
def latex_visit_eqref(self, node):
|
||||
@ -87,7 +87,7 @@ def text_visit_displaymath(self, node):
|
||||
raise nodes.SkipNode
|
||||
|
||||
def text_visit_eqref(self, node):
|
||||
self.add_text(node['label'])
|
||||
self.add_text(node['target'])
|
||||
raise nodes.SkipNode
|
||||
|
||||
|
||||
|
@ -23,7 +23,8 @@ sys.path.append(os.path.abspath('.'))
|
||||
|
||||
# Add any Sphinx extension module names here, as strings. They can be extensions
|
||||
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
|
||||
extensions = ['ext', 'sphinx.ext.autodoc']
|
||||
extensions = ['ext', 'sphinx.ext.autodoc', 'sphinx.ext.jsmath']
|
||||
jsmath_path = 'dummy.js'
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ['_templates']
|
||||
|
@ -13,6 +13,7 @@ Contents:
|
||||
images
|
||||
includes
|
||||
markup
|
||||
math
|
||||
|
||||
Indices and tables
|
||||
==================
|
||||
|
22
tests/root/math.txt
Normal file
22
tests/root/math.txt
Normal file
@ -0,0 +1,22 @@
|
||||
Test math extensions
|
||||
====================
|
||||
|
||||
This is inline math: :math:`a^2 + b^2 = c^2`.
|
||||
|
||||
.. math:: a^2 + b^2 = c^2
|
||||
|
||||
.. math::
|
||||
|
||||
a^2 + b^2 = c^2
|
||||
|
||||
.. math::
|
||||
:label: foo
|
||||
|
||||
e^{i\pi} = 1
|
||||
|
||||
.. math::
|
||||
:label:
|
||||
|
||||
e^{ix} = \cos x + i\sin x
|
||||
|
||||
Referencing equation :eq:`foo`.
|
Loading…
Reference in New Issue
Block a user