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

Appearance settings

Tweak mathtext/tex docs. #22364

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 3, 2022
Merged

Tweak mathtext/tex docs. #22364

merged 1 commit into from
Jul 3, 2022

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Jan 31, 2022

  • Fix typos/mismatched parentheses/markup in mathtext.py.
  • Make the title of pgf.py consistent with the title of usetex.py.
  • Prefer "modern" approach for setting fonts in usetex.py, but keep the
    old approach around (as the new API is only on Matplotlib 3.5).
  • Clarify non-standard tex settings.

PR Summary

PR Checklist

Tests and Styling

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (install flake8-docstrings and run flake8 --docstring-convention=all).

Documentation

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

tutorials/text/mathtext.py Show resolved Hide resolved
Times and Palatino each have their own accompanying math fonts, while the other
Adobe serif fonts make use of the Computer Modern math fonts.

To enable LaTeX and select a font, use e.g.::
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't terribly clear terminology, so maybe needs a bit more explanation. Is "font.family": "Helvetica" supposed to be a shortcut or are we claiming "Helvetica" is actually a font family? To me a "font family" is a set of fonts that provides serif/sans-serif/different weights, etc. But thats not how we are using it here?

Given that most folks using usetex are probably familiar with this from latex, is it not helpful to state explicitly what package is used?

I'm not sure this change is right or desirable, though the previous text could be fixed as well...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Helvetica" is a "font family" (see e.g. https://developer.mozilla.org/en-US/docs/Web/CSS/font-family) (it's a called a family because it can exist in bold/italic/etc.). Note that this is like setting font.family: DejaVu Sans in non-usetex mode. This terminology is also consistent with tex (see e.g. table 3 in http://mirrors.ctan.org/macros/latex/required/psnfss/psnfss2e.pdf). I slightly tweaked the wording, does it help?

I made the change because this was describing a relatively more complex way to set the font, whereas a simpler approach is now available.

I agreed that listing the tex packages is probably helpful, now done.

@QuLogic QuLogic requested a review from jklymak February 8, 2022 04:37
@tacaswell tacaswell closed this Jun 30, 2022
@tacaswell tacaswell reopened this Jun 30, 2022
@tacaswell
Copy link
Member

"power-cycled" to re-run CI against current main.

Copy link
Member

@tacaswell tacaswell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyone can merge on green.

@QuLogic
Copy link
Member

QuLogic commented Jul 1, 2022

Doesn't seem to have re-run docs; maybe a rebase would do?

- Fix typos/mismatched parentheses/markup in mathtext.py.
- Make the title of pgf.py consistent with the title of usetex.py.
- Prefer "modern" approach for setting fonts in usetex.py, but keep the
  old approach around (as the new API is only on Matplotlib 3.5).
- Clarify non-standard tex settings.
@anntzer
Copy link
Contributor Author

anntzer commented Jul 3, 2022

rebased.

@timhoffm timhoffm added this to the v3.6.0 milestone Jul 3, 2022
@timhoffm timhoffm merged commit cd9d371 into matplotlib:main Jul 3, 2022
@anntzer anntzer deleted the mathdoc branch July 3, 2022 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.