r"$\|$" should render as a double vertical bar, which it does with usetex or with math_fontfamily="cm", but not with the default "dejavusans" math_fontfamily.
It would seem reasonable to fix the baseline image (preferably after #22881, as usual: here again, what really matters is that the right glyph gets embedded, not the exact glyph-to-path conversion).
(I haven't checked that the proposed fix works, but it doesn't have to be complicated indeed.)
I only checked the png output visually. The svg output actually didn't error I realize, so I should probably check that (pdf did error though). Primary problem of fixing it is right now that some of the other pngs error on my machine, so not sure it is a good idea to upload images with slightly off fonts (RMS in the range 1 to 3...).
In the Inkscape installer, is there an option like "add inkscape to PATH"? If so easiest would be to just document that it needs to be installed in this manner.
In the Inkscape installer, is there an option like "add inkscape to PATH"?
Yes. I just installed 1.2 to check it, but got an error saying that the PATH was too long to modify. I solved it earlier by simply adding the correct path though.
(I do not think there needs to be an issue for me being lazy/ignorant, or it would be a pretty long issue...)
Well, we should at least document that inkscape needs to be installed with that option checked, as that seems like a useful piece of info for other newcomers...
Edit: and I realize that my change above could work, but then there are no alternatives so AutoHeightChar breaks on init as char is not set (as alternatives is empty, I assume). If you put 8124 instead of 8214...
Activity
oscargus commented on Jun 11, 2022
\Vert seems to work though.
oscargus commented on Jun 11, 2022
It is just to change
matplotlib/lib/matplotlib/_mathtext_data.py
Line 529 in ee7c4a0
to
But the base line images are incorrect:
https://github.com/matplotlib/matplotlib/blob/main/lib/matplotlib/tests/baseline_images/test_mathtext/mathtext_dejavusans_68.png
matplotlib/lib/matplotlib/tests/test_mathtext.py
Line 103 in ee7c4a0
The second b should have double vertical bars around it.
oscargus commented on Jun 11, 2022
And the problem holds for any other font than cm it seems.
anntzer commented on Jun 11, 2022
It would seem reasonable to fix the baseline image (preferably after #22881, as usual: here again, what really matters is that the right glyph gets embedded, not the exact glyph-to-path conversion).
(I haven't checked that the proposed fix works, but it doesn't have to be complicated indeed.)
oscargus commented on Jun 12, 2022
I only checked the png output visually. The svg output actually didn't error I realize, so I should probably check that (pdf did error though). Primary problem of fixing it is right now that some of the other pngs error on my machine, so not sure it is a good idea to upload images with slightly off fonts (RMS in the range 1 to 3...).
oscargus commented on Jun 12, 2022
And that is because on my Windows machine, the svg tests are not executed. But I can confirm that the PDFs are now correct.
anntzer commented on Jun 12, 2022
Do you have inkscape installed? If so, svg tests should be executed (if not, please open a separate bug and let's fix that...).
oscargus commented on Jun 12, 2022
I have it installed, but, as so often for Windows, not in the PATH. I thought it could be related to something like that. Will try to sort it out.
oscargus commented on Jun 12, 2022
Now it breaks SVG as well, so as far as I call tell, it seems to fully work to simply change that.
anntzer commented on Jun 12, 2022
Anyways, this should probably be moved to a separate issue to keep track of it.
oscargus commented on Jun 12, 2022
Yes. I just installed 1.2 to check it, but got an error saying that the PATH was too long to modify. I solved it earlier by simply adding the correct path though.
(I do not think there needs to be an issue for me being lazy/ignorant, or it would be a pretty long issue...)
anntzer commented on Jun 12, 2022
Well, we should at least document that inkscape needs to be installed with that option checked, as that seems like a useful piece of info for other newcomers...
oscargus commented on Aug 20, 2022
Maybe related. Today I realized that autoscaling of | and \| does not work properly.
plt.text(0.05, 0.05, r'$\left|\frac{\frac{3}{2}}{1}\right\|$ $\left(\frac{\frac{3}{2}}{1}\right)$')'cm' seems to work though:
Edit: and I realize that my change above could work, but then there are no alternatives so AutoHeightChar breaks on init as char is not set (as alternatives is empty, I assume). If you put 8124 instead of 8214...