Using plain TeX coding, how to I include the current font name in the document? I know it involves \the\font but can't recall the exact method.

This is for use in a font-sampler, so that before each font sample, an appropriate title appears identifying that font.


You can use \fontname\font to output the current font name in your document:

    % set font style and save name
    % print small sample
    {\leavevmode\tt\hbox to 1in{\savedname:\hss}}%
    abcxyz ABCXYZ 123\par

enter image description here


From the TeXbook (p. 214)

  • \the\⟨font⟩ produces a font identifier that selects the specified font. For example, ‘\the\font’ is a control sequence corresponding to the current font.

This is most useful only in \edef, to get an alias command for the current font:


{\thisfont abc}

will produce the same result.

For the external name of the current font, use \fontname\font (current font) or \fontname\tenrm (or whatever font selection command you want to use):





enter image description here


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.