Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 29466fb

Browse filesBrowse files
committed
Fix \sqrt with a numeric radical.
svn path=/branches/v0_91_maint/; revision=4911
1 parent 50babfa commit 29466fb
Copy full SHA for 29466fb

File tree

Expand file treeCollapse file tree

3 files changed

+8
-14
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+8
-14
lines changed

‎CHANGELOG

Copy file name to clipboardExpand all lines: CHANGELOG
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2008-01-31 Fix \sqrt with radical number (broken by making [ and ]
2+
work below) - MGD
3+
14
2008-01-10 Fix bug displaying [ and ] in mathtext - MGD
25

36
2008-01-10 Fix bug when displaying a tick value offset with scientific

‎examples/mathtext_examples.py

Copy file name to clipboardExpand all lines: examples/mathtext_examples.py
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
r"$f^'$",
4141
r'$\frac{x_2888}{y}$',
4242
r"$\sqrt[3]{\frac{X_2}{Y}}=5$",
43-
r"$\sqrt[5x\pi]{\prod^\frac{x}{2\pi^2}_\infty}$",
43+
r"$\sqrt[5]{\prod^\frac{x}{2\pi^2}_\infty}$",
4444
r"$\sqrt[3]{x}=5$",
4545
r'$\frac{X}{\frac{X}{Y}}$',
4646
# From UTR #25
@@ -56,7 +56,7 @@
5656

5757
def doall():
5858
tests = stests
59-
59+
6060
figure(figsize=(8, (len(tests) * 1) + 2))
6161
plot([0, 0], 'r')
6262
grid(False)
@@ -69,7 +69,7 @@ def doall():
6969
savefig('mathtext_examples')
7070
#close('all')
7171
show()
72-
72+
7373
if '--latex' in sys.argv:
7474
fd = open("mathtext_examples.ltx", "w")
7575
fd.write("\\documentclass{article}\n")

‎lib/matplotlib/mathtext.py

Copy file name to clipboardExpand all lines: lib/matplotlib/mathtext.py
+2-11Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2109,12 +2109,7 @@ def __init__(self):
21092109
)
21102110
+ Optional(
21112111
Suppress(Literal("["))
2112-
+ Group(
2113-
OneOrMore(
2114-
(c_over_c | symbol)
2115-
^ font
2116-
)
2117-
)
2112+
+ Regex("[0-9]+")
21182113
+ Suppress(Literal("]")),
21192114
default = None
21202115
)
@@ -2607,11 +2602,7 @@ def sqrt(self, s, loc, toks):
26072602
if root is None:
26082603
root = Box(0., 0., 0.)
26092604
else:
2610-
if not isinstance(root, ParseResults):
2611-
raise ParseFatalException(
2612-
"Can not parse root of radical. "
2613-
"Only simple symbols are allowed in the root.")
2614-
root = Hlist(root.asList())
2605+
root = Hlist([Char(x, state) for x in root])
26152606
root.shrink()
26162607
root.shrink()
26172608

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.