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

Skip to content

Commit 0949b31

Browse files
committed
Add more sizeable delimiters
1 parent 02d2e13 commit 0949b31

File tree

5 files changed

+24
-3
lines changed

5 files changed

+24
-3
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
``mathtext`` has more sizable delimiters
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
The ``\lgroup`` and ``\rgroup`` sizable delimiters have been added.
5+
6+
The following delimiter names have been supported earlier, but can now be sized with
7+
``\left`` and ``\right``:
8+
9+
* ``\lbrace``, ``\rbrace``, ``\leftbrace``, and ``\rightbrace``
10+
* ``\lbrack`` and ``\rbrack``
11+
* ``\leftparen`` and ``\rightparen``
12+
13+
There are really no obvious advantages in using these.
14+
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
@@ -1808,8 +1808,12 @@ class _MathStyle(enum.Enum):
18081808
_ambi_delims = set(r"""
18091809
| \| / \backslash \uparrow \downarrow \updownarrow \Uparrow
18101810
\Downarrow \Updownarrow . \vert \Vert""".split())
1811-
_left_delims = set(r"( [ \{ < \lfloor \langle \lceil".split())
1812-
_right_delims = set(r") ] \} > \rfloor \rangle \rceil".split())
1811+
_left_delims = set(r"""
1812+
( [ \{ < \lfloor \langle \lceil \lbrace \leftbrace \lbrack \leftparen \lgroup
1813+
""".split())
1814+
_right_delims = set(r"""
1815+
) ] \} > \rfloor \rangle \rceil \rbrace \rightbrace \rbrack \rightparen \rgroup
1816+
""".split())
18131817
_delims = _left_delims | _right_delims | _ambi_delims
18141818

18151819
_small_greek = set([unicodedata.name(chr(i)).split()[-1].lower() for i in

lib/matplotlib/_mathtext_data.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -957,6 +957,8 @@
957957
'cwopencirclearrow' : 8635,
958958
'geqq' : 8807,
959959
'rightleftarrows' : 8644,
960+
'lgroup' : 0x27EE,
961+
'rgroup' : 0x27EF,
960962
'aa' : 229,
961963
'ac' : 8766,
962964
'ae' : 230,
@@ -1016,7 +1018,7 @@
10161018
'leftparen' : 40,
10171019
'rightparen' : 41,
10181020
'bigoplus' : 10753,
1019-
'leftbrace' : 124,
1021+
'leftbrace' : 123,
10201022
'rightbrace' : 125,
10211023
'jmath' : 567,
10221024
'bigodot' : 10752,

lib/matplotlib/tests/test_mathtext.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@
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 -}$',
137137
r'$\boldsymbol{abcde} \boldsymbol{+} \boldsymbol{\Gamma + \Omega} \boldsymbol{01234} \boldsymbol{\alpha * \beta}$',
138+
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\lgroup \frac{A}{B}\right\rgroup \right\rightparen$',
138139
]
139140

140141
digits = "0123456789"

0 commit comments

Comments
 (0)