8000 Add more sizeable delimiters · matplotlib/matplotlib@ba34f20 · GitHub
[go: up one dir, main page]

Skip to content

Commit ba34f20

Browse files
committed
Add more sizeable delimiters
1 parent 623da30 commit ba34f20

File tree

5 files changed

+20
-4
lines changed

5 files changed

+20
-4
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
``mathtext`` has more sizable delimiters
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
The following delimiter names have been supported earlier, but can now be sized with
5+
``\left`` and ``\right``:
6+
7+
* ``\lbrace``, ``\rbrace``, ``\leftbrace``, and ``\rightbrace``
8+
* ``\lbrack`` and ``\rbrack``
9+
* ``\leftparen`` and ``\rightparen``
10+
11+
There are really no obvious advantages in using these.
12+
Instead, they are are added for completeness.

lib/matplotlib/_mathtext.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1807,8 +1807,12 @@ class _MathStyle(enum.Enum):
18071807
_ambi_delims = set(r"""
18081808
| \| / \backslash \uparrow \downarrow \updownarrow \Uparrow
18091809
\Downarrow \Updownarrow . \vert \Vert""".split())
1810-
_left_delims = set(r"( [ \{ < \lfloor \langle \lceil".split())
1811-
_right_delims = set(r") ] \} > \rfloor \rangle \rceil".split())
1810+
_left_delims = set(r"""
1811+
( [ \{ < \lfloor \langle \lceil \lbrace \leftbrace \lbrack \leftparen
1812+
""".split())
1813+
_right_delims = set(r"""
1814+
) ] \} > \rfloor \rangle \rceil \rbrace \rightbrace \rbrack \rightparen
1815+
""".split())
18121816
_delims = _left_delims | _right_delims | _ambi_delims
18131817

18141818
def __init__(self):

lib/matplotlib/_mathtext_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1016,7 +1016,7 @@
10161016
'leftparen' : 40,
10171017
'rightparen' : 41,
10181018
'bigoplus' : 10753,
1019-
'leftbrace' : 124,
1019+
'leftbrace' : 123,
10201020
'rightbrace' : 125,
10211021
'jmath' : 567,
10221022
'bigodot' : 10752,
Loading

lib/matplotlib/tests/test_mathtext.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134
r'$\sum x\quad\sum^nx\quad\sum_nx\quad\sum_n^nx\quad\prod x\quad\prod^nx\quad\prod_nx\quad\prod_n^nx$', # GitHub issue 18085
135135
r'$1.$ $2.$ $19680801.$ $a.$ $b.$ $mpl.$',
136136
r'$\text{text}_{\text{sub}}^{\text{sup}} + \text{\$foo\$} + \frac{\text{num}}{\mathbf{\text{den}}}\text{with space, curly brackets \{\}, and dash -}$',
137-
137+
r'$\left\lbrace\frac{\left\lbrack A^b_c\right\rbrace}{\left\leftbrace D^e_f \right\rbrack}\right\rightbrace\ \left\leftparen\max_{x} \left\vert \frac{A}{B}\right\vert \right\rightparen$',
138138
]
139139

140140
digits = "0123456789"

0 commit comments

Comments
 (0)
0