Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2afba2a

Browse files
committed
Fix \sqrt (broken when I made the parser more strict).
svn path=/trunk/matplotlib/; revision=3732
1 parent fffd947 commit 2afba2a

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

lib/matplotlib/_mathtext_data.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
r'\bigwedge' : ('cmex10', 4),
3131
r'\bigvee' : ('cmex10', 37),
3232
r'\coprod' : ('cmex10', 42),
33+
r'\__sqrt__' : ('cmex10', 48),
3334
r'\leftbrace' : ('cmex10', 92),
3435
r'{' : ('cmex10', 92),
3536
r'\{' : ('cmex10', 92),
@@ -316,6 +317,7 @@
316317
r'\Pi' : ('psyr', 213),
317318
r'\prod' : ('psyr', 213),
318319
r'\surd' : ('psyr', 214),
320+
r'\__sqrt__' : ('psyr', 214),
319321
r'\cdot' : ('psyr', 215),
320322
r'\urcorner' : ('psyr', 216),
321323
r'\vee' : ('psyr', 217),
@@ -2044,6 +2046,7 @@
20442046
'rightzigzagarrow': 8669,
20452047
'rightarrow': 8594,
20462048
'leftarrow': 8592,
2049+
'__sqrt__': 8730,
20472050
'twoheaddownarrow': 8609,
20482051
'oint': 8750,
20492052
'bigvee': 8897,
@@ -2553,6 +2556,7 @@
25532556
'rightzigzagarrow': 'uni21DD',
25542557
'rightarrow': 'uni2192',
25552558
'leftarrow': 'uni2190',
2559+
'__sqrt__': 'uni221A',
25562560
'twoheaddownarrow': 'uni21A1',
25572561
'oint': 'uni222E',
25582562
'bigvee': 'uni22C1',

lib/matplotlib/mathtext.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ def _get_glyph(self, fontname, sym, fontsize):
645645
('ex', '\xbf'), ('ex', '\x2a')],
646646
r'\rangle' : [('cal', '\x69'), ('ex', '\xae'), ('ex', '\x45'),
647647
('ex', '\xc0'), ('ex', '\x2b')],
648-
r'\sqrt' : [('cal', '\x70'), ('ex', '\x70'), ('ex', '\x71'),
648+
r'\__sqrt__' : [('cal', '\x70'), ('ex', '\x70'), ('ex', '\x71'),
649649
('ex', '\x72'), ('ex', '\x73')],
650650
r'\backslash': [('cal', '\x6e'), ('ex', '\xb2'), ('ex', '\x2f'),
651651
('ex', '\xc2'), ('ex', '\x2d')],
@@ -2296,7 +2296,7 @@ def sqrt(self, s, loc, toks):
22962296
# the height so it doesn't seem cramped
22972297
height = body.height - body.shift_amount + thickness * 5.0
22982298
depth = body.depth + body.shift_amount
2299-
check = AutoHeightChar(r'\sqrt', height, depth, state, always=True)
2299+
check = AutoHeightChar(r'\__sqrt__', height, depth, state, always=True)
23002300
height = check.height - check.shift_amount
23012301
depth = check.depth + check.shift_amount
23022302

0 commit comments

Comments
 (0)