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

Skip to content

Commit bdd8df3

Browse files
committed
Do not space symbols in limits
1 parent fcf75dd commit bdd8df3

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

doc/sphinxext/math_symbol_table.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@
6767
\hslash \blacksquare \blacktriangle \sharp \increment
6868
\prime \blacktriangledown \Im \flat \backprime \Re \natural
6969
\circledS \P \copyright \circledR \S \yen \checkmark \$
70-
\cent \triangle \QED \sinewave \dag \ddag \perthousand
71-
\lambdabar \L \l \degree \danger \maltese
70+
\cent \triangle \QED \sinewave \dag \ddag \perthousand \ac
71+
\lambdabar \L \l \degree \danger \maltese \clubsuitopen
7272
\i \hermitmatrix \sterling \nabla \mho""".split()],
7373
]
7474

@@ -83,7 +83,7 @@ def render_symbol(sym, ignore_variant=False):
8383
if sym not in (_mathtext.Parser._overunder_functions |
8484
_mathtext.Parser._function_names):
8585
sym = chr(_mathtext_data.tex2uni[sym])
86-
return f'\\{sym}' if sym in ('\\', '|') else sym
86+
return f'\\{sym}' if sym in ('\\', '|', '+', '-', '*') else sym
8787

8888
lines = []
8989
for category, columns, syms in symbols:
@@ -145,6 +145,7 @@ def setup(app):
145145

146146
# Add accents
147147
all_symbols.update({v[1:]: k for k, v in _mathtext.Parser._accent_map.items()})
148+
all_symbols.update({v: v for v in _mathtext.Parser._wide_accents})
148149
print("SYMBOLS NOT IN TABLE:")
149150
for sym, val in _mathtext_data.tex2uni.items():
150151
if sym not in all_symbols:

lib/matplotlib/_mathtext.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1799,7 +1799,7 @@ class _MathStyle(enum.Enum):
17991799
\varniobar \niobar \bagmember \ratio
18001800
\Equiv \stareq \measeq \arceq
18011801
\rightassert \rightModels \smallin \smallowns
1802-
\notsmallowns'''.split())
1802+
\notsmallowns \nsimeq'''.split())
18031803

18041804
_arrow_symbols = set(r"""
18051805
\leftarrow \longleftarrow \uparrow \Leftarrow \Longleftarrow
@@ -2154,9 +2154,11 @@ def symbol(self, s, loc, toks):
21542154
# such as ${ -2}$, $ -2$, or $ -2$.
21552155
prev_char = next((c for c in s[:loc][::-1] if c != ' '), '')
21562156
# Binary operators at start of string should not be spaced
2157-
if (c in self._binary_operators and
2158-
(len(s[:loc].split()) == 0 or prev_char == '{' or
2159-
prev_char in self._left_delims)):
2157+
# Also, operators in sub- or superscripts should not be spaced
2158+
if (self._in_subscript_or_superscript or (
2159+
c in self._binary_operators and (
2160+
len(s[:loc].split()) == 0 or prev_char == '{' or
2161+
prev_char in self._left_delims))):
21602162
return [char]
21612163
else:
21622164
return [Hlist([self._make_space(0.2),

lib/matplotlib/_mathtext_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -910,7 +910,7 @@
910910
'O' : 216,
911911
'hookleftarrow' : 8617,
912912
'trianglerighteq' : 8885,
913-
'nsime' : 8772,
913+
'nsimeq' : 8772,
914914
'oe' : 339,
915915
'nwarrow' : 8598,
916916
'o' : 248,

0 commit comments

Comments
 (0)