The commands in <ENC>enc.def
files allow encoding-specific
commands to be defined, but they do not allow commands to be used in
other encodings. For example, the OMS encoding contains the symbol
`§', but we need to be able to use the command \S
in any encoding,
not just OMS.
To allow this, LaTeX has commands for giving default definitions
for commands, which are used when the command is not defined in the
current encoding. For example, the default encoding for \S
is OMS,
and so in an encoding (such as OT1) which does not contain \S
, the
OMS version is selected. But in an encoding (such as T1) which does
contain \S
, the version for that encoding is used.
Note: These commands should not occur in <ENC>enc.def
files, since these should only define commands for that encoding.
They should instead be placed in packages.
\DeclareTextCommandDefault
{<cmd>} {<definition>}
This command allows an encoding-specific command to be given a default
definition. For example, the default definition for \copyright
is
defined be be a circled `c' with:
\DeclareTextCommandDefault{\copyright}{\textcircled{c}}
\DeclareTextAccentDefault
{<cmd>} {<encoding>}
\DeclareTextSymbolDefault
{<cmd>} {<encoding>}
These commands allow an encoding-specific command to be given a
default encoding. For example, the default encoding for \"
and
\ae
is set to be OT1 by:
\DeclareTextAccentDefault{\"}{OT1} \DeclareTextSymbolDefault{\ae}{OT1}Note that
\DeclareTextAccentDefault
can be used on any one-argument
encoding-specific command, not just those defined with
\DeclareTextAccent
. Similarly, \DeclareTextSymbolDefault
can be
used on any encoding-specific command with no arguments, not just
those defined with \DeclareTextSymbol
.
For more examples of these definitions, see ltoutenc.dtx
.
\ProvideTextCommandDefault
{<cmd>} {<definition>}
This command is the same as \DeclareTextCommandDefault
, except that
if the command already has a default definition, then the definition
is ignored. This is useful to give `faked' definitions of symbols
which may be given `real' definitions by other packages. For example,
a package might give a fake definition of \textonequarter
by saying:
\ProvideTextCommandDefault{\textonequarter}{$\m@th\frac14$}