blob: de8459decabad1fd803f96a5c0f28c87ffa2e30b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
%
% File: ITALIC.TEX
%
% Author: Hunter Goatley
% goathunter@goatley.com
%
% Date: August 21, 1991
%
% Abstract:
%
% The macros \ital and \slant are defined to typeset tex in italic
% (\it) and slanted (\sl) fonts, automatically inserting the italic
% correction (\/) if necessary. The correction is not inserted if
% the token following the parameter is a period or a comma, as
% suggested on page 14 of _The TeXbook_.
%
% Based on the \predict macro presented in _TeX for the Impatient_,
% p. 233.
%
% These macros use \toks0 as a temporary.
%
% The \futurelet\it@next in \ital and \slant defines \it@next to be
% whatever the character following the parameter is. \d@slant checks
% to see if \it@next is a comma or period; if it is neither, the
% italic correction (\/) is included.
%
\catcode`\@=11 % Temporarily make @ a letter
\def\ital#1{\toks0={#1}\let\slf@nt=\it\futurelet\it@next\d@slant}
\def\slant#1{\toks0={#1}\let\slf@nt=\sl\futurelet\it@next\d@slant}
\def\d@slant{{\slf@nt\the\toks0}%
\ifx\it@next,% % If \it@next is not a comma
\else\ifx\it@next.% % ... and is not a period
\else\/% % ... insert the correction (\/)
\fi\fi% % ...
\let\it@next=\relax% % "Undefine" \it@next
}
\catcode`\@=12 % Reset @ as other
|