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

In usetex, remove vertical space inserted by TeX after displaymath.#24011

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

Draft
anntzer wants to merge1 commit intomatplotlib:main
base:main
Choose a base branch
Loading
fromanntzer:dm
Draft
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
8 changes: 8 additions & 0 deletionslib/matplotlib/tests/test_usetex.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,6 +8,7 @@
from matplotlib.testing import _has_tex_package
from matplotlib.testing.decorators import check_figures_equal, image_comparison
from matplotlib.testing._markers import needs_usetex
from matplotlib.texmanager import TexManager
import matplotlib.pyplot as plt


Expand DownExpand Up@@ -138,3 +139,10 @@ def test_missing_psfont(fmt, monkeypatch):
ax.text(0.5, 0.5, 'hello')
with TemporaryFile() as tmpfile, pytest.raises(ValueError):
fig.savefig(tmpfile, format=fmt)


def test_ends_with_displaymath():
# Check that we do not include extra vspace after displaymath.
text = r'\begin{eqnarray*} foo \\ bar \end{eqnarray*}'
w, h, d = TexManager().get_text_width_height_descent(text, 12)
assert d == 0 # no extra descent on the last line.
2 changes: 1 addition & 1 deletionlib/matplotlib/texmanager.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -231,7 +231,7 @@ def _get_tex_source(cls, tex, fontsize):
rf"\fontsize{{{fontsize}}}{{{baselineskip}}}%",
r"\ifdefined\psfrag\else\hbox{}\fi%",
rf"{{\obeylines{fontcmd} {tex}}}%",
r"\special{matplotlibbaselinemarker}%",
r"\vskip-\lastskip\special{matplotlibbaselinemarker}%",
r"\end{document}",
])

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp