summaryrefslogtreecommitdiff
path: root/macros/plain/contrib/newsletr/italic.tex
diff options
context:
space:
mode:
Diffstat (limited to 'macros/plain/contrib/newsletr/italic.tex')
-rw-r--r--macros/plain/contrib/newsletr/italic.tex37
1 files changed, 37 insertions, 0 deletions
diff --git a/macros/plain/contrib/newsletr/italic.tex b/macros/plain/contrib/newsletr/italic.tex
new file mode 100644
index 0000000000..de8459deca
--- /dev/null
+++ b/macros/plain/contrib/newsletr/italic.tex
@@ -0,0 +1,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