Skip to content

Add mappings for bold and italic cal font class - #26419

Draft
devRD wants to merge 1 commit into
matplotlib:mainfrom
devRD:mt-calsyms
Draft

devRD wants to merge 1 commit into
matplotlib:mainfrom
devRD:mt-calsyms

Conversation

@devRD

@devRD devRD commented Jul 31, 2023 •

Copy link
Copy Markdown
Contributor

PR summary

Fixes #22056

PR checklist

@devRD
devRD marked this pull request as draft July 31, 2023 14:03
@devRD

devRD commented Jul 31, 2023

Copy link
Copy Markdown
Contributor Author

From the #22056 discussion, it seems using plt.rcParams['font.weight'] = 'bold' seems to be problematic. Using the \mathbfit command to fetch the bold calligraphy fonts could be a way forward (?)

fontsets = ["dejavusans", "dejavuserif", "cm", "stixsans", "stix"]
for x, fs in enumerate(fontsets):
    s = "$\mathrm{%s}: \mathcal{ABCDE} \mathbfit{\mathcal{ABCDE}}$" % (fs)
    ...

cal_bold

@devRD

devRD commented Aug 3, 2023 •

Copy link
Copy Markdown
Contributor Author

Hi @ksunden, I investigated further on this issue and listing my findings on this:

References:

  • From my understanding, I think neither DejaVu Sans nor Stix provides the bold mathcal Unicode. Although the Computer Modern font provides bold versions for mathcal from the cmbsy10 font listed here, integrating that results in the following:
    bold cal

However, it does not make much sense to add a new font just for Computer Modern, or to add the Euler-math font. So this issue could be closed as expected LaTeX behavior because default LaTeX does not seem to provide it simply either.
As a side note, I could add the cmbsy10 changes here as a reference for the user or maybe an example plot or something (?)

Some more useful references:
https://tug.org/TUGboat/tb33-3/tb105vieth.pdf
https://cs.brown.edu/about/system/managed/latex/doc/euler.pdf
https://tex.stackexchange.com/questions/580904/accessing-all-possible-math-styles-of-the-stix-font

This branch has not been deployed

No deployments
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.

[Bug]: \mathcal does not work when font.weight is "bold"

1 participant