Is there any reason(s) not to use \let
to redefine \bf
to \bfseries
and \it
to \itshape
?
Yes, there are good reasons. :-) With the above \let
-based setup, {\bf\it ...}
produces bold-italic. In contrast, in a plain-TeX document {\bf\it ...}
produces italic text. If the goal is to make \bf
and \it
behave the same way in LaTeX and plain-TeX, the \let
-based setup isn't the way to go.
The LaTeX kernel doesn't define \bf
, \it
, \rm
, \sc
, \sf
, \sl
, and \tt
. However, the standard LaTeX document classes -- article
, report
, and book
-- and classes that are based on the standard classes do define these macros. For instance, article.cls
features the following instructions:
\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm}
\DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf}
\DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt}
\DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf}
\DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit}
\DeclareOldFontCommand{\sl}{\normalfont\slshape}{\@nomath\sl}
\DeclareOldFontCommand{\sc}{\normalfont\scshape}{\@nomath\sc}
The macro \DeclareOldFontCommand
takes three arguments. It is defined in latex.ltx
(the LaTeX "kernel") as follows:
\def\DeclareOldFontCommand #1#2#3{\DeclareRobustCommand #1{\@fontswitch {#2}{#3}}}
As you can see, considerable care is being taken in the "porting" of the plain-TeX font-switching macros to LaTeX. For one, different commands are needed for text mode and for math mode. And, the \normalfont
instructions (in the text-mode cases) assure that the font-switching commands behave the same in LaTeX as they do in plain-TeX.
Incidentally, \@nomath
is defined as follows:
\def\@nomath#1{\relax\ifmmode
\@font@warning{Command \noexpand#1invalid in math mode}\fi}
Attempts to use \sl
and \sc
in math mode will therefore trigger warning messages, to the effect that these commands are invalid in math mode. (Of course, to generate words rendered in slanted or small-cap letters while in math mode, one can use \textsl{...}
and \textsc{...}
.)
Addendum: For completeness, here's the definition of \@fontswitch
(also from latex.ltx
):
\def \@fontswitch #1#2{%
\ifmmode
\let \math@bgroup \relax
\def \math@egroup {\let \math@bgroup \@@math@bgroup
\let \math@egroup \@@math@egroup}%
#2\relax
\else
#1%
\fi
}
Thus, if one of the deprecated commands is encountered in text mode, the command appropriate for text mode is chosen; conversely, if it's encountered in math mode, the math-mode-appropriate command is selected after fine-tuning some of the math-grouping commands.
\bfseries
and\itshape
... don't work in math mode – touhami Apr 14 '16 at 16:50\bfseries
, etc., and has given up\bf
"forever" when using latex, that user is likely to inadvertently use the "plain" sequences in places where they would work in plain tex, leading to possibly confusing errors. – barbara beeton Apr 14 '16 at 17:03