File: italic.tex

package info (click to toggle)
texlive-extra 2020.20210202-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 3,974,756 kB
  • sloc: perl: 208,744; cs: 25,850; python: 22,859; sh: 16,844; makefile: 15,571; ansic: 13,649; java: 12,741; xml: 4,930; lisp: 1,708; javascript: 1,351; csh: 1,129; ruby: 938; awk: 151; tcl: 142; cpp: 41; sed: 36; pascal: 18
file content (37 lines) | stat: -rw-r--r-- 1,253 bytes parent folder | download | duplicates (9)
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