How to make \mathdefault{} the default?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to make \mathdefault{} the default?

Daniele Nicolodi
Hello,

when adding LaTeX symbols to labels on my figures, most often I use
\mathdefault{} to make Matplotlib use the same fond for the regular text
and for the LaTeX part.  Is there a way to configure Matplotlib to use
the regular text by default?  Looking at the configuration file I
haven't found anything hinting to it.

Thanks. Cheers,
Daniele
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: How to make \mathdefault{} the default?

Daniele Nicolodi
On 10/3/17 2:59 PM, Daniele Nicolodi wrote:
> Hello,
>
> when adding LaTeX symbols to labels on my figures, most often I use
> \mathdefault{} to make Matplotlib use the same fond for the regular text
> and for the LaTeX part.  Is there a way to configure Matplotlib to use
> the regular text by default?  Looking at the configuration file I
> haven't found anything hinting to it.

After staring a bit more at the example configuration file, I can answer
my own question.  This does the trick:

matplotlib.rcParams['mathtext.fontset'] = 'custom'

I'm a bit worried by the note next to this setting in the example
configuration file, though:

# The following settings allow you to select the fonts in math mode.
# They map from a TeX font name to a fontconfig font pattern.
# These settings are only used if mathtext.fontset is 'custom'.
# Note that this "custom" mode is unsupported and may go away in the
# future.

Why is it unsupported?  I find this functionality very neat.

Thanks. Cheers,
Daniele
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users