How can I display the font size in use at a particular point of the document.

For example, in the following code, I produced a PDF file showing the fonts actually used for each shape and size,



\definecolor{mred} {cmyk}{0,1,1,0.6}

\setmainfont{Minion Pro}

  \foreach \size in
  {normalsize, Large, Huge}

  \foreach \shape in {up, it, sc, bf}
  {\par\csname text\shape\endcsname


This will produce the following. (as you see fontspec or luaotfload does not select correct optical fonts, see my answer for Using MinionPro for the main font and Fontspec for the monospaced font of how to workaround this)

My question is that, instead of print "normalize", "Large", "Huge", I would like to print things like "10pt" or just "10", so I can see the actual font size, just like in this example I can see the actual fonts used.

I know this can be done with things like Acrobat. But in that way, one has to click numerous times of his mouse to examine the fonts. I would prefer a more automatically way, similar to the way I print the fonts names in the example.

Many thanks in advance.


  • How do you know that the font size is a length and not a unitless number? Moreover, how do you know that the correct unit after \f@size is pt? Commented Jan 19, 2014 at 0:00

2 Answers 2


I don't know whether I understand you question right. Here is my interpretation ;-)

orig: \f@size

\verb+\small+ \small \f@size

\verb+\normalsize+ \normalsize \f@size

\verb+\large+ \large \f@size

\verb+\Huge+ \Huge \f@size

\f@size is the internal macro in LaTeX2e NFSS. If a font is not specified through NFSS, this may fail. To know the size of LaTeX commands like \large, you can read classes document.

Furthermore, you don't need to use direct Lua code to get the font name.

Here is the low-level method to show the font size:

\font\1="TeX Gyre Termes"

\fontname\font\ at \the\fontdimen6\font
% cmr10 at 10.00002pt

\fontname\font\ at \the\fontdimen6\font
% TeX Gyre Termes at 10.0pt

\fontdimen6 is the length of 1em. \font after \fontname and \fontdimen means current font. See Chapter 4 of TeX by Topic for more explanations.

  • I know \fontname, but it won't work very well. For example it will give the following while loading fonts with fontspec MinionPro/S=8:mode=node;script=latn;language=DFLT;+liga;+tlig;+trep;+onum;+pnum;expansion = default;protrusion = mnr; at 5.0pt. It is much better to have Minion Pro Caption than MinionPro/S=8
    – Yan Zhou
    Commented Jun 11, 2011 at 9:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .