# How to determine the font being used by a latex document

The scenario is as follows. I am working on a paper using the IEEEtran latex class. I am generating some figures using the Matplotlib plotting library in Python. Matplotlib lets the user adjust the font and compile figures with the help of tex so that you can get nice looking fonts in your figure labels which match the font used in the document the figures are going into. What I would like to know though, is what font is the IEEEtran class actually using so that I can configure Matplotlib to use the same font?

I guess this problem generalizes beyond IEEEtran which I happen to be using. Short of eyeballing a font, is there a reliable way to determine which font is being used at a given point in a document? I'm guessing the font can be overridden in any one of a million possible places, so I'm really interested in knowing whether there is a generalized solution that isn't "read through the manual of whatever class files/other files you're using until you figure it out". Is there a command I can put inline in the middle of a paragraph or something that will tell me the font details in the current context?

-
Export your data to `pgfplots` and you don't need to tweak anything at all. –  percusse Apr 20 '13 at 6:45
@percusse I have complex plots generated in matplotlib - I'd rather not learn yet another plotting library just for the sake of figure insertion. –  Bryce Thomas Apr 20 '13 at 8:34
We'll talk again when IEEE sends back the article for the final proof :) –  percusse Apr 20 '13 at 8:38

To show the font at the current point you can use

``````\showthe\font
``````

TeX will stop as if for an error message (just hit return and it will carry on) the message will look something like

``````> \OT1/cmr/m/n/10 .
``````

which means classic (OT1) font encoded computer modern roman (cmr) medium weight (m) normal shape (n) 10pt (10) font.

Alternatively (or as well) you can use

``````\expandafter\show\the\font
``````

In which case you get (in this document)

``````> \OT1/cmr/m/n/10=select font cmr10.
<inserted text> \OT1/cmr/m/n/10
``````

which tells you that the actual font metric file is `cmr10.tfm` That possibly more closely corresponds to the font name to use in other applications.

-

• Times for `\textrm`
• Helvetica for `\textsf`
• Courier for `\texttt`
you should create a MWE with the IEEE class. The resulted pdf can be analyzed with `pdffonts` (on Linux). In a MWE, not so much fonts should be included. Not the smartest way, but hopefully a step to solve the issue.