next up previous contents
Next: Math fonts Up: Text fonts Previous: Parameters for author commands

Special font declaration commands


\DeclareFixedFont {<cmd>} {<encoding>} {<family>} {<series>} {<shape>} {<size>}

Declares command <cmd> to be a font switch which selects the font that is specified by the attributes <encoding>, <family>, <series>, <shape>, and <size>.

The font is selected without any adjustments to baselineskip and other surrounding conditions.

This example makes {\picturechar .} select a small dot very quickly:

   \DeclareFixedFont{\picturechar}{OT1}{cmr}{m}{n}{5}


\DeclareTextFontCommand {<cmd>} {<font-switches>}

Declares command <cmd> to be a font command with one argument. The current font attributes are locally modified by <font-switches> and then the argument of <cmd> is typeset in the resulting new font.

Commands defined by \DeclareTextFontCommand automatically take care of any necessary italic correction (on either side).

The following example shows how \textrm is defined by the kernel.

   \DeclareTextFontCommand{\textrm}{\rmfamily}

To define a command that always typeset its argument in the italic shape of the main document font you could declare:

   \DeclareTextFontCommand{\normalit}{\normalfont\itshape}

This declaration can be used to change the meaning of a command; if <cmd> is already defined, a log that it has been redefined is put in the transcript file.


\DeclareOldFontCommand {<cmd>} {<text-switch>} {<math-switch>}

Declares command <cmd> to be a font switch (i.e. used with the syntax {<cmd>...}) having the definition <text-switch> when used in text and the definition <math-switch> when used in a formula. Math alphabet commands, like \mathit, when used within <math-switch> should not have an argument. Their use in this argument causes their semantics to change so that they here act as a font switch, as required by the usage of the <cmd>.

This declaration is useful for setting up commands like \rm to behave as they did in LaTeX 2.09. We strongly urge you not to misuse this declaration to invent new font commands.

The following example defines \it to produce the italic shape of the main document font if used in text and to switch to the font that would normally be produced by the math alphabet \mathit if used in a formula.

   \DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit}

This declaration can be used to change the meaning of a command; if <cmd> is already defined, a log that it has been redefined is put in the transcript file.


next up previous contents
Next: Math fonts Up: Text fonts Previous: Parameters for author commands

Rainer Schoepf
Thu Jan 8 11:52:24 MET 1998