TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have read TeX Frequently Asked Questions -- What’s wrong with \newfont?, however, I'd still like to know the answer to this. In a style file I'm using there is:

\newfont{\myfont}{cmr17 scaled 2000}

... however, I'd like to "overload" / redefine this with a smaller scaling (1200) after the style file is loaded (still in the document preamble, though). I guess I'd like to use something like \renewfont{\myfont}{cmr17 scaled 2000} - but obviously, \renewfont doesn't exist :)

Since \newfont defines the command name cmd, which must not be currently defined, I guess the answer to the question is negative - but I better make sure and ask: is there a technique that would allow me to "overload" a font made by \newfont?

share|improve this question
up vote 5 down vote accepted

Well as the faq mentions \newfont is a really simple wrapper around the primitive \font. It actually simply adds a test if the font is already defined. So if you want to overwrite the definition simply use the primitive command:

\font\myfont=cmr17 scaled 1200 \relax

But my advice would be to avoid such hard coded font definitions. They make maintaining a style difficult and - as you see - making small changes awkward.

share|improve this answer
Many thanks, @Ulrike Fischer - good to know the 'TeX primitive' way too; cheers! – sdaau Oct 7 '11 at 10:10

Thanks to Joon's Blog: How to undefine a command in LaTeX, I think I have it:

% undefine \myfont

% ... then define it again: 
\newfont{\myfont}{cmr17 scaled 1200}

Hope this helps someone,

share|improve this answer
No need for \makeatletter: \let\myfont\relax is sufficient. – egreg Oct 6 '11 at 21:45
Many thanks for that @egreg - I'm never exactly sure when to "protect" with \makeatletter; good to know it's not needed here... Cheers! – sdaau Oct 7 '11 at 7:06

This code will make \xnewfont have the same syntax as \newfont, but it will reject the definition of the control sequence only if it's not a font choosing command and, in that case, it will overwrite it.

However, Ulrike's suggestion should be followed: define fonts in term of higher level macros such as \usefont.

    \def\next{\message{*** Overwriting meaning of font \string#1*** ^^J}%
  \edef\next{\next\detokenize{select font}\noexpand\@nil}%
    \def\noexpand\ch@ck@ffont##1\detokenize{select font}##2\noexpand\@nil}%
share|improve this answer
Cheers @egreg - looks quite awesome, this code; definitely worth some closer study! – sdaau Oct 7 '11 at 13:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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