Next: Obsolete commands Up: Upgrading LATEX 2.09 classes and Previous: Accommodating compatibility mode Contents

## Font commands

Some font and size commands are now defined by the document class rather than by the LATEX kernel. If you are upgrading a LATEX 2.09 document style to a class that does not load one of the standard classes, then you will probably need to add definitions for these commands.

`\rm` `\sf` `\tt` `\bf` `\it` `\sl` `\sc`

None of these short-form font selection commands are defined in the LATEX2e kernel. They are defined by all the standard class files.

If you want to define them in your class file, there are several reasonable ways to do this.

One possible definition is:

       \newcommand{\rm}{\rmfamily}
       ...
       \newcommand{\sc}{\scshape}

This would make the font commands orthogonal; for example `{\bf\it text}` would produce bold italic, thus: text. It will also make them produce an error if used in math mode.

Another possible definition is:

       \DeclareOldFontCommand{\rm}{\rmfamily}{\mathrm}
       ...
       \DeclareOldFontCommand{\sc}{\scshape}{\mathsc}

This will make `\rm` act like `\rmfamily` in text mode (see above) and it will make `\rm` select the `\mathrm` math alphabet in math mode.

Thus `${\rm math} = X + 1$` will produce ` '.

If you do not want font selection to be orthogonal then you can follow the standard classes and define:

       \DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm}
       ...
       \DeclareOldFontCommand{\sc}{\normalfont\scshape}{\mathsc}

This means, for example, that `{\bf\it text}` will produce medium weight (rather than bold) italic, thus: text.

`\normalsize`
`\@normalsize`

The command `\@normalsize` is retained for compatibility with LATEX 2.09 packages which may have used its value; but redefining it in a class file will have no effect since it is always reset to have the same meaning as `\normalsize`.

This means that classes must now redefine `\normalsize` rather than redefining `\@normalsize`; for example (a rather incomplete one):

       \renewcommand{\normalsize}{\fontsize{10}{12}\selectfont}

Note that `\normalsize` is defined by the LATEX kernel to be an error message.

`\tiny` `\footnotesize` `\small` `\large`
`\Large` `\LARGE` `\huge` `\Huge`

None of these other `standard' size-changing commands are defined in the kernel: each needs to be defined in a class file if you need it. They are all defined by the standard classes.

This means you should use `\renewcommand` for `\normalsize` and `\newcommand` for the other size-changing commands.

Next: Obsolete commands Up: Upgrading LATEX 2.09 classes and Previous: Accommodating compatibility mode Contents