@@ -1778,7 +1778,7 @@ class _MathStyle(enum.Enum):
17781778 \triangleright \ntriangleleft \ntriangleright
17791779 \trianglelefteq \ntrianglelefteq \trianglerighteq
17801780 \ntrianglerighteq \blacktriangleleft \blacktriangleright
1781- \equalparallel \measuredrightangle \lrtriangle
1781+ \equalparallel \measuredrightangle \varlrtriangle
17821782 \Doteq \Bumpeq \Subset \Supset
17831783 \backepsilon \because \therefore \bot
17841784 \top \bumpeq \circeq \coloneq
@@ -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 ),
0 commit comments