1
Description: change default math output format to HTML
2
Author: Jakub Wilk <jwilk@debian.org>
4
Bug-Debian: http://bugs.debian.org/677929
5
Last-Update: 2013-05-16
7
--- a/docs/user/config.txt
8
+++ b/docs/user/config.txt
10
The format of mathematical content (`math directive`_ and role) in
11
the output document. Supported values are (case insensitive):
14
+ Format math in standard HTML enhanced by CSS rules
16
+ Requires the ``math.css`` stylesheet (stored in the same
17
+ installation-dependent directory as the `default stylesheet`__).
19
+ .. __: `stylesheet_path [html4css1 writer]`_
22
Format math for display with MathJax_, a JavaScript-based math
23
rendering engine that uses HTML/CSS, JavaScript, and unicode
26
Downloads JavaScript code from a third-party site.
29
- Format math in standard HTML enhanced by CSS rules
31
- Requires the ``math.css`` stylesheet (stored in the same
32
- installation-dependent directory as the `default stylesheet`__).
34
- .. __: `stylesheet_path [html4css1 writer]`_
37
Embed math content as presentational MathML_.
41
The failsave fallback.
43
- Default: MathJax Option: ``--math-output``.
44
+ Default: HTML Option: ``--math-output``.
48
--- a/docutils/writers/html4css1/__init__.py
49
+++ b/docutils/writers/html4css1/__init__.py
53
('Math output format, one of "MathML", "HTML", "MathJax" '
54
- 'or "LaTeX". Default: "MathJax"',
55
+ 'or "LaTeX". Default: "HTML"',
57
- {'default': 'MathJax'}),
58
+ {'default': 'HTML'}),
59
('Omit the XML declaration. Use with caution.',
60
['--no-xml-declaration'],
61
{'dest': 'xml_declaration', 'default': 1, 'action': 'store_false',
62
--- a/test/functional/expected/standalone_rst_html4css1.html
63
+++ b/test/functional/expected/standalone_rst_html4css1.html
65
<meta name="copyright" content="This document has been placed in the public domain. You may do with it as you wish. You may copy, modify, redistribute, reattribute, sell, buy, rent, lease, destroy, or improve it, quote it at length, excerpt, incorporate, collate, fold, staple, or mutilate it, or do anything else to it that your or anyone else's heart desires." />
66
<meta content="reStructuredText, test, parser" name="keywords" />
67
<meta content="A test document, containing at least one example of each reStructuredText construct." lang="en" name="description" />
68
-<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
69
<link rel="stylesheet" href="../input/data/html4css1.css" type="text/css" />
73
or as base for special code roles, e.g. the LaTeX code in the next
75
<p>Docutils uses LaTeX syntax for math directives and roles:
76
-<code class="tex">\alpha = f(x)</code> prints <span class="math">\(\alpha = f(x)\)</span>
77
+<code class="tex">\alpha = f(x)</code> prints <span class="formula"><i>α</i> = <i>f</i>(<i>x</i>)</span>
79
<p>The <tt class="docutils literal">:code:</tt> option of the <cite>include</cite> directive sets the included content
80
as a code block, here the rst file <tt class="docutils literal">header_footer.txt</tt> with line numbers:</p>
81
--- a/test/test_writers/test_html4css1_misc.py
82
+++ b/test/test_writers/test_html4css1_misc.py
86
def test_math_output_default(self):
87
- # Currently MathJax with default URL. Likely to change to HTML!
89
mysettings = self.settings_overrides
90
head = core.publish_parts(self.data, writer_name='html4css1',
91
- settings_overrides=mysettings)['head']
92
- self.assertIn(self.mathjax_script % self.default_mathjax_url, head)
93
+ settings_overrides=mysettings)['head']
94
+ self.assertNotIn('MathJax.js', head)
96
def test_math_output_mathjax(self):
97
# Explicitly specifying math_output=MathJax, case insensitively