Change \mu to \textmu
SirJohnFranklin opened this issue · 3 comments
SirJohnFranklin commented
Hey,
nice package!
One thing came to my mind using it: The \mu for micrometer is of italic type which is not correct in my opinion.
You could change:
latexrepr = '$\\mu$m'
to
latexrepr = '$\\mathrm{\\mu}$m'
in dimensions.py, line 88.
Best,
SJF
ppinard commented
Committed, it will be part of the next release.
AKuederle commented
Just for future reference: If there is need for a custom symbol or text, this can be accomplished with the label_formatter
attribute. I originally implemented it to get the proper
As example: Before the implemented change one could do the following:
def custom_formatter(value, unit):
if unit=='$\\mu$m':
unit = '$\\mathrm{\\mu}$m'
return '{} {}'.format(value, unit)
my_bar = ScaleBar(..., label_formatter=custom_formatter)
ppinard commented
Good to know. It is good to see that the label_formatter
can be used for many things 😄