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

Skip to content

Commit 27831c3

Browse files
committed
Add ?, ! and & symbols to mathtext. Closes #466.
1 parent 76acbb6 commit 27831c3

12 files changed

Lines changed: 444 additions & 3 deletions

lib/matplotlib/_mathtext_data.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
r'7' : ('cmr10', 127),
109109
r'8' : ('cmr10', 77),
110110
r'9' : ('cmr10', 22),
111-
r' :' : ('cmr10', 85),
111+
r':' : ('cmr10', 85),
112112
r';' : ('cmr10', 31),
113113
r'=' : ('cmr10', 41),
114114
r'\leftbracket' : ('cmr10', 62),
@@ -243,6 +243,9 @@
243243
r'\rightarrow' : ('cmsy10', 12),
244244
r'\to' : ('cmsy10', 12),
245245
r'\spadesuit' : ('cmsy10', 7),
246+
r'?' : ('cmr10', 50),
247+
r'!' : ('cmr10', 29),
248+
r'&' : ('cmr10', 109)
246249
}
247250

248251
latex_to_cmex = {

lib/matplotlib/mathtext.py

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

21802180
unicode_range = u"\U00000080-\U0001ffff"
2181-
symbol =(Regex(UR"([a-zA-Z0-9 +\-*/<>=:,.;!'@()\[\]|%s])|(\\[%%${}\[\]_|])" % unicode_range)
2181+
symbol =(Regex(UR"([a-zA-Z0-9 +\-*/<>=:,.;!\?&'@()\[\]|%s])|(\\[%%${}\[\]_|])" % unicode_range)
21822182
| (Combine(
21832183
bslash
21842184
+ oneOf(tex2uni.keys())
Binary file not shown.
1.22 KB
Loading
Lines changed: 165 additions & 0 deletions
Loading
Binary file not shown.
1.24 KB
Loading
Lines changed: 136 additions & 0 deletions
Loading
Binary file not shown.
1.24 KB
Loading

0 commit comments

Comments
 (0)