I was reading this question and I was wondering whether there is any package in LaTeX compatible with PDFtex that returns the name of the font, not the family font as an alphanumeric string. What comes to mind is using this list here or the documentation for fontname on texdoc; however, I haven't been able to find a command that does what I want. The reason is that I'm teaching an introductory course to LaTeX and I have this font comparison file:





\foreach \fuent in {ppl,qbk,ptm,qzc,put,pbk,bch,BaskervilleF-TLF}
            \fbox{\fontname\font} \\

This is going to be analysed at some point during the course, but first I just want to print the output PDF and distribute it, with the font names at the top of each column.

Does this exist? Is it necessary to dwell into the nuts and bolts of @s and \relax for this? Thanks in advance!

  • 1
    You mean names like "TeX Gyre Termes"? They are not accessible from pdflatex. Btw: don't use the ae package. This is not needed in a modern tex system. Mar 6, 2020 at 7:30
  • Thanks! I use ae because otherwise the Trajan font won't compile. Mar 6, 2020 at 17:54
  • Then correct these fonts, or don't use them. A file meant for a introduction in latex shouldn't use a package like ae. Mar 6, 2020 at 18:05
  • how can the Trajan font require you to use ae package so affecting the default fonts for the whole document? Mar 6, 2020 at 18:50
  • I don't know; I just know that if I don't load ae, this font doesn't appear; I get an error line in the log file saying the trjn family doesn't exist. Mar 7, 2020 at 19:08

1 Answer 1


You can use \meaning as in :

enter image description here



1: \expandafter\meaning\the\font

2: \bfseries \expandafter\meaning\the\font

However while this can be useful for low level debugging of the font handling I would not use it in any tutorial. The whole point of the font selection system is to refer to a font via meaningful attributes like bold or italic, the mapping to the actual name in the filesystem such as cmbx10 is a low level implementation detail contained in the .fd files but should not be of interest to any normal use of the system

  • That's interesting. However, apparently what I want is impossible using pdflatex :( Mar 6, 2020 at 17:54
  • @ÓscarGuajardo yes I realised later that you meant "name of font" in a different sense. I might delete Mar 6, 2020 at 18:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.