Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit80721d5

Browse files
committed
Add more sizeable delimiters
1 parent623da30 commit80721d5

File tree

5 files changed

+24
-4
lines changed

5 files changed

+24
-4
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
@@ -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 \lgroup
1812+
""".split())
1813+
_right_delims=set(r"""
1814+
) ] \} > \rfloor \rangle \rceil \rbrace \rightbrace \rbrack \rightparen \rgroup
1815+
""".split())
18121816
_delims=_left_delims|_right_delims|_ambi_delims
18131817

18141818
def__init__(self):

‎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 & 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\lgroup \frac{A}{B}\right\rgroup \right\rightparen$',
138138
]
139139

140140
digits="0123456789"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp