You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note the unicode µ in what it prints when you run it, and how it compiles:
Whereas if I simply add a .replace("µ", "\\mu ") I get:
Which is better of course, but I guess not ideal, because the font is italic. I wonder if we should simply apply the above .replace here:
diff --git i/pint/delegates/formatter/latex.py w/pint/delegates/formatter/latex.py
index 476997b..84f05ac 100644
--- i/pint/delegates/formatter/latex.py+++ w/pint/delegates/formatter/latex.py@@ -198,8 +198,8 @@ class LatexFormatter(BaseFormatter):
registry=self._registry,
)
- numerator = ((rf"\mathrm{{{latex_escape(u)}}}", p) for u, p in numerator)- denominator = ((rf"\mathrm{{{latex_escape(u)}}}", p) for u, p in denominator)+ numerator = ((rf"\mathrm{{{latex_escape(u)}}}".replace("µ", "\\mu "), p) for u, p in numerator)+ denominator = ((rf"\mathrm{{{latex_escape(u)}}}".replace("µ", "\\mu "), p) for u, p in denominator)
# Localized latex
# if babel_kwds.get("locale", None):
The text was updated successfully, but these errors were encountered:
Here's a test case:
Note the unicode
µ
in what it prints when you run it, and how it compiles:Whereas if I simply add a
.replace("µ", "\\mu ")
I get:Which is better of course, but I guess not ideal, because the font is italic. I wonder if we should simply apply the above
.replace
here:The text was updated successfully, but these errors were encountered: