Toggle, Turn-on, and Turn-off
There are three types of behavior:
TOGGLE Behavior
- if italics were ON, turn italics OFF
- if italics were OFF turn italics ON
- TURN ON Behavior
- If already on, stays on.
- if italic text mode is turned on, keep it on
- if italic text mode was turned off, turn italics on
- TURN OFF Behavior
- If already off, stays off.
- if italic text mode is turned on, turn it off
- if italic text mode was turned off, keep it off
Example of a Toggle Italics Command
\em
has toggle behavior. Which letter A
s in the following source code snippet become italic in the output depends completely upon whether the first line is commented out or not.
% \em
AAA \em AAA \em AAA
We could get:
AAA AAA AAA
or
AAA AAA AAA
\itshape
(also\em
is a deprecated command in LaTeX.) See Will two-letter font style commands (\bf , \it , …) ever be resurrected in LaTeX?\em
is an exception to the two-letter-deprecation rule.\emph
is defined with\DeclareTextFontCommand{\emph}{\em}
as\textit
is defined with\DeclareTextFontCommand{\textit}{\itshape}
...latex.ltx
(lines 4056 and 4060).