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

Fix #4335: mathtext whitespacing commands#4403

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletionsdoc/api/api_changes.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,6 +11,12 @@ help figure out possible sources of the changes you are experiencing.
For new features that were added to matplotlib, please see
:ref:`whats-new`.

Changes in 2.0.x
================

* The spacing commands in mathtext have been changed to more closely
match vanilla TeX.

Changes in 1.4.x
================

Expand Down
2 changes: 0 additions & 2 deletionslib/matplotlib/_mathtext_data.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1946,7 +1946,6 @@
'boxminus' : 8863,
'equiv' : 8801,
'Lleftarrow' : 8666,
'thinspace' : 8201,
'll' : 8810,
'Cup' : 8915,
'measeq' : 8798,
Expand DownExpand Up@@ -2169,7 +2168,6 @@
'cdots' : 8943,
'hat' : 770,
'eqgtr' : 8925,
'enspace' : 8194,
'psi' : 968,
'frown' : 8994,
'acute' : 769,
Expand Down
19 changes: 12 additions & 7 deletionslib/matplotlib/mathtext.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2431,13 +2431,18 @@ def _make_space(self, percentage):
self._em_width_cache[key] = width
return Kern(width * percentage)

_space_widths = { r'\ ' : 0.3,
r'\,' : 0.4,
r'\;' : 0.8,
r'\quad' : 1.6,
r'\qquad' : 3.2,
r'\!' : -0.4,
r'\/' : 0.4 }
_space_widths = { r'\,' : 0.16667, # 3/18 em = 3 mu
r'\thinspace' : 0.16667, # 3/18 em = 3 mu
r'\/' : 0.16667, # 3/18 em = 3 mu
r'\>' : 0.22222, # 4/18 em = 4 mu
r'\:' : 0.22222, # 4/18 em = 4 mu
r'\;' : 0.27778, # 5/18 em = 5 mu
r'\ ' : 0.33333, # 6/18 em = 6 mu
r'\enspace' : 0.5, # 9/18 em = 9 mu
r'\quad' : 1, # 1 em = 18 mu
r'\qquad' : 2, # 2 em = 36 mu
r'\!' : -0.16667, # -3/18 em = -3 mu
}
def space(self, s, loc, toks):
assert(len(toks)==1)
num = self._space_widths[toks[0]]
Expand Down
View file
Open in desktop
Binary file not shown.
View file
Open in desktop
Loading
Sorry, something went wrong.Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View file
Open in desktop
Loading
Sorry, something went wrong.Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View file
Open in desktop
Binary file not shown.
View file
Open in desktop
Loading
Sorry, something went wrong.Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View file
Open in desktop
Loading
Sorry, something went wrong.Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong.Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View file
Open in desktop
Loading
Sorry, something went wrong.Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletionlib/matplotlib/tests/test_mathtext.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -90,7 +90,8 @@
r"$\left(2 \, a=b\right)$", # Sage bug #8125
r"$? ! &$", # github issue #466
r'$\operatorname{cos} x$', # github issue #553
r'$\sum _{\genfrac{}{}{0}{}{0\leq i\leq m}{0<j<n}}P\left(i,j\right)$'
r'$\sum _{\genfrac{}{}{0}{}{0\leq i\leq m}{0<j<n}}P\left(i,j\right)$',
r'$M \, M \thinspace M \/ M \> M \: M \; M \ M \enspace M \quad M \qquad M \! M$'
]

digits = "0123456789"
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp