Skip to content

Commit 014bcf3

Browse files
committed
Support '|' as a symbol in mathtext.
svn path=/trunk/matplotlib/; revision=4586
1 parent a79942e commit 014bcf3

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

lib/matplotlib/_mathtext_data.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@
9090
r'\phi' : ('cmmi10', 42),
9191
r'\chi' : ('cmmi10', 17),
9292
r'\psi' : ('cmmi10', 31),
93-
93+
94+
r'|' : ('cmsy10', 47),
95+
r'\|' : ('cmsy10', 47),
9496
r'(' : ('cmr10', 119),
9597
r'\leftparen' : ('cmr10', 119),
9698
r'\rightparen' : ('cmr10', 68),
@@ -129,7 +131,7 @@
129131
r'\Phi' : ('cmr10', 9),
130132
r'\Psi' : ('cmr10', 15),
131133
r'\Omega' : ('cmr10', 12),
132-
134+
133135
# these are mathml names, I think. I'm just using them for the
134136
# tex methods noted
135137
r'\circumflexaccent' : ('cmr10', 124), # for \hat
@@ -400,7 +402,7 @@
400402
r'\}' : ('pncr8a', 125),
401403
r'\backslash' : ('pncr8a', 92),
402404
r'\ast' : ('pncr8a', 42),
403-
405+
404406
r'\circumflexaccent' : ('pncri8a', 124), # for \hat
405407
r'\combiningbreve' : ('pncri8a', 81), # for \breve
406408
r'\combininggraveaccent' : ('pncri8a', 114), # for \grave
@@ -1773,6 +1775,7 @@
17731775
'succnsim': 8937,
17741776
'gimel': 8503,
17751777
'vert': 124,
1778+
'|': 124,
17761779
'varrho': 1009,
17771780
'P': 182,
17781781
'approxident': 8779,
@@ -2073,7 +2076,7 @@
20732076
'rightzigzagarrow': 8669,
20742077
'rightarrow': 8594,
20752078
'leftarrow': 8592,
2076-
'__sqrt__': 8730,
2079+
'__sqrt__': 8730,
20772080
'twoheaddownarrow': 8609,
20782081
'oint': 8750,
20792082
'bigvee': 8897,
@@ -2238,7 +2241,7 @@
22382241
'{': 123,
22392242
'}': 125,
22402243
'_': 95,
2241-
'imath': 0x131,
2244+
'imath': 0x131,
22422245
'circumflexaccent' : 770,
22432246
'combiningbreve' : 774,
22442247
'combiningoverline' : 772,
@@ -2471,5 +2474,5 @@
24712474
(0x0061, 0x007a, 'rm', 0x1d68a) # a-z
24722475
],
24732476
}
2474-
2475-
2477+
2478+

lib/matplotlib/mathtext.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2021,7 +2021,7 @@ def __init__(self):
20212021
).setParseAction(self.customspace).setName('customspace')
20222022

20232023
unicode_range = u"\U00000080-\U0001ffff"
2024-
symbol =(Regex(UR"([a-zA-Z0-9 +\-*/<>=:,.;!'@()%s])|(\\[%%${}\[\]_])" % unicode_range)
2024+
symbol =(Regex(UR"([a-zA-Z0-9 +\-*/<>=:,.;!'@()|%s])|(\\[%%${}\[\]_|])" % unicode_range)
20252025
| Combine(
20262026
bslash
20272027
+ oneOf(tex2uni.keys())

0 commit comments

Comments
 (0)