diff --git a/doc/api/prev_api_changes/api_changes_3.1.0.rst b/doc/api/prev_api_changes/api_changes_3.1.0.rst index 2c0f629729db..b6e3ff8c4733 100644 --- a/doc/api/prev_api_changes/api_changes_3.1.0.rst +++ b/doc/api/prev_api_changes/api_changes_3.1.0.rst @@ -727,7 +727,7 @@ Mathtext changes Deprecations ~~~~~~~~~~~~ -- The ``\stackrel`` mathtext command hsa been deprecated (it behaved differently +- The ``\stackrel`` mathtext command has been deprecated (it behaved differently from LaTeX's ``\stackrel``. To stack two mathtext expressions, use ``\genfrac{left-delim}{right-delim}{fraction-bar-thickness}{}{top}{bottom}``. - The ``\mathcircled`` mathtext command (which is not a real TeX command) diff --git a/lib/matplotlib/mathtext.py b/lib/matplotlib/mathtext.py index 1b46fc6dcd7d..d174aaf556f3 100644 --- a/lib/matplotlib/mathtext.py +++ b/lib/matplotlib/mathtext.py @@ -2396,7 +2396,6 @@ def __init__(self): p.accentprefixed = Forward() p.space = Forward() p.sqrt = Forward() - p.stackrel = Forward() p.start_group = Forward() p.subsuper = Forward() p.subsuperop = Forward() @@ -2481,12 +2480,6 @@ def __init__(self): | Error(r"Expected \dfrac{num}{den}")) ) - p.stackrel <<= Group( - Suppress(Literal(r"\stackrel")) - - ((p.required_group + p.required_group) - | Error(r"Expected \stackrel{num}{den}")) - ) - p.binom <<= Group( Suppress(Literal(r"\binom")) - ((p.required_group + p.required_group) @@ -2543,7 +2536,6 @@ def __init__(self): | p.group | p.frac | p.dfrac - | p.stackrel | p.binom | p.genfrac | p.sqrt diff --git a/lib/matplotlib/tests/test_mathtext.py b/lib/matplotlib/tests/test_mathtext.py index 6bc84b19f1eb..91a72a648441 100644 --- a/lib/matplotlib/tests/test_mathtext.py +++ b/lib/matplotlib/tests/test_mathtext.py @@ -214,8 +214,6 @@ def test_fontinfo(): (r'$\hspace{foo}$', r'Expected \hspace{n}'), (r'$\frac$', r'Expected \frac{num}{den}'), (r'$\frac{}{}$', r'Expected \frac{num}{den}'), - (r'$\stackrel$', r'Expected \stackrel{num}{den}'), - (r'$\stackrel{}{}$', r'Expected \stackrel{num}{den}'), (r'$\binom$', r'Expected \binom{num}{den}'), (r'$\binom{}{}$', r'Expected \binom{num}{den}'), (r'$\genfrac$', @@ -238,8 +236,6 @@ def test_fontinfo(): 'hspace with invalid value', 'frac without parameters', 'frac with empty parameters', - 'stackrel without parameters', - 'stackrel with empty parameters', 'binom without parameters', 'binom with empty parameters', 'genfrac without parameters', diff --git a/tutorials/text/mathtext.py b/tutorials/text/mathtext.py index 7b5b078b4fa2..709f1df4956b 100644 --- a/tutorials/text/mathtext.py +++ b/tutorials/text/mathtext.py @@ -97,7 +97,7 @@ .. math:: - \frac{3}{4} \binom{3}{4} \stackrel{}{}{0}{}{3}{4} + \frac{3}{4} \binom{3}{4} \genfrac{}{}{0}{}{3}{4} Fractions can be arbitrarily nested::