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

Support\underline in Mathtext.#23616

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
tfpf wants to merge3 commits intomatplotlib:main
base:main
Choose a base branch
Loading
fromtfpf:underline
Draft

Conversation

tfpf
Copy link
Contributor

@tfpftfpf commentedAug 14, 2022
edited
Loading

PR Summary

#15624 hasn't seen any activity for a while, so I went ahead with this.

Note that the underline is drawn below the lowest descender. This is consistent with TeX. (The PNG images suffer from what I assume is pixel rounding.)

Fixes#14235.
Closes#15624

PR Checklist

Tests and Styling

  • Has pytest style unit tests (andpytest passes).
  • IsFlake 8 compliant (installflake8-docstrings and runflake8 --docstring-convention=all).

Documentation

  • New features are documented, with examples if plot related.
  • New features have an entry indoc/users/next_whats_new/ (follow instructions in README.rst there).
  • [N/A] API changes documented indoc/api/next_api_changes/ (follow instructions in README.rst there).
  • Documentation is sphinx and numpydoc compliant (the docs shouldbuild without error).

@tfpftfpf marked this pull request as ready for reviewAugust 14, 2022 13:06
@oscargus
Copy link
Member

Looks good! I think it makes sense to add a brief What's new for this to make users aware that it is added.

Also, I think it may be enough to have a "lightweight" test for this as it doesn't seem very dependent on the font:

# 'lightweight' tests test only a single fontset (dejavusans, which is the
# default) and only png outputs, in order to minimize the size of baseline
# images.
lightweight_math_tests= [
r'$\sqrt[ab]{123}$',# github issue #8665
r'$x \overset{f}{\rightarrow} \overset{f}{x} \underset{xx}{ff} \overset{xx}{ff} \underset{f}{x} \underset{f}{\leftarrow} x$',# github issue #18241
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
r'$1.$ $2.$ $19680801.$ $a.$ $b.$ $mpl.$',
]

tfpf reacted with thumbs up emoji

@timhoffmtimhoffm requested a review fromanntzerAugust 15, 2022 08:04
@timhoffm
Copy link
Member

@anntzer I think you as our TeX expert should review this.

@anntzer
Copy link
Contributor

Sure, l'll need a couple of days though.

timhoffm reacted with thumbs up emoji

@anntzer
Copy link
Contributor

This seems reasonable, but 1) do you know why the overline() implementation is so different, using a fill instead? (which seems inconsistent with the TeXbook); 2) the TeXbook (rules G9/G10 p443) add an extrathickness of whitespace clearance over the overline / under the underline; do you know why they are not needed here (if they indeed aren't)?

@tfpf
Copy link
ContributorAuthor

tfpf commentedAug 20, 2022
edited
Loading

the TeXbook (rules G9/G10 p443) add an extra thickness of whitespace clearance over the overline / under the underline

I think that extra space is used to set the minimum leading.

more_leading
If the leading is high, the vertical distance between the tops of the Ts and the underscores on the previous lines remains unchanged even if the underscores are underlined. (As if the underline wasn't there at all.)

less_leading
Upon reducing the leading, the Ts remain some distance away from the underline. It's like the underline forces the next line to go lower if it is too close.

I have not looked through Mathtext's leading rules, but it certainly looks like it's better to follow what TeX does.I will update this. Getting second thoughts about this now. Should I add that space at the bottom, or leave this as it is?

do you know why the overline() implementation is so different, using a fill instead

That's a good question, one which I wondered myself, but couldn't figure out. In fact, I haven't completely understood how glue works in Mathtext.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@oscargusoscargusoscargus approved these changes

@anntzeranntzerAwaiting requested review from anntzer

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Add \underline to mathtext?
4 participants
@tfpf@oscargus@timhoffm@anntzer

[8]ページ先頭

©2009-2025 Movatter.jp