#16396: upgrade Sphinx to 1.2
-------------------------------------+-------------------------------------
Reporter: rws | Owner:
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-6.3
Component: documentation | Resolution:
Keywords: speed, slow, | Merged in:
build, rst | Reviewers:
Authors: | Work issues:
Report Upstream: Reported | Commit:
upstream. No feedback yet. | 53bf86e6d78f000e728cf3d57efa2a62d1664412
Branch: | Stopgaps:
u/rws/upgrade_sphinx_to_1_2 |
Dependencies: |
-------------------------------------+-------------------------------------
Comment (by strogdon):
I believe I have a patch that's not to invasive, i.e. it basically reverts
to the old behavior when using inline math and doesn't disrupt (hopefully)
the need to use pure tex in a verbatim (alltt) environment. I'll post here
since it will take me time to remember how to commit
{{{
--- sphinx/writers/latex.py.orig 2014-06-05 23:38:03.808669401
-0500
+++ sphinx/writers/latex.py 2014-06-05 23:27:22.752376713 -0500
@@ -264,6 +264,7 @@
self.next_figure_ids = set()
self.next_table_ids = set()
# flags
+ self.verbatim = False
self.in_title = 0
self.in_production_list = 0
self.in_footnote = 0
@@ -1319,6 +1320,7 @@
(self.curfilestack[-1], node.line))
if node.rawsource != node.astext():
# most probably a parsed-literal block -- don't highlight
+ self.verbatim = True
self.body.append('\\begin{alltt}\n')
else:
code = node.astext().rstrip('\n')
@@ -1351,6 +1353,7 @@
raise nodes.SkipNode
def depart_literal_block(self, node):
self.body.append('\n\\end{alltt}\n')
+ self.verbatim = False
visit_doctest_block = visit_literal_block
depart_doctest_block = depart_literal_block
--- sphinx/ext/mathbase.py.orig 2014-06-05 23:39:36.773293241 -0500
+++ sphinx/ext/mathbase.py 2014-06-05 23:18:53.949020605 -0500
@@ -88,7 +88,10 @@
def latex_visit_math(self, node):
- self.body.append('\\(' + node['latex'] + '\\)')
+ if self.verbatim:
+ self.body.append('\\(' + node['latex'] + '\\)')
+ else:
+ self.body.append('$' + node['latex'] + '$')
raise nodes.SkipNode
def latex_visit_displaymath(self, node):
}}}
--
Ticket URL: <http://trac.sagemath.org/ticket/16396#comment:22>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.