1
votes

I am using the ieeconf latex class to write a document. To generate the plots for the document, I use matplotlib 1.2. For some reason, the ieeconf class uses Times font for regular text and Computer modern roman for math text. If in matplotlib I use the following matplotlibrc file

font.family         : serif
font.serif          : Times
text.usetex         : True

the regular text (non-math) in the plots looks exactly like the regular text in the rest of the document. However, the math text in the plots looks different to the math text in the document. If instead I use font.serif : Computer Modern Roman, then the roles are reversed, and the math texts look identical, but the regular ones look different.

How can I make matplotlib use one font type for the regular text, and another font type for the math text?

1

1 Answers

2
votes

In Matplotlib you can give Latex commands using: rc('text.latex', preamble = [r'']) (sort of like they do it here: http://matplotlib.org/users/pgf.html#custom-preamble). Then this may help you out: https://tex.stackexchange.com/questions/5675/how-to-change-math-font-only