Foreign
Foreign
Philip G. Ratcliffe†
Dipartimento di Scienze e Alta Tecnologia
Università degli Studi dell’Insubria—Como
Abstract
This package affords the user automatic typeface differentiation (e.g. by
italicising) of foreign (e.g. Latin) words, phrases and abbreviations. It is
supplied with a number of predefined words, phrases and abbreviations that
should normally be italicised in an English text. Macros are automatically
applied to add periods and/or commas, where necessary. Note that, since
the basic definitions are universal in form, the package is easily adaptable to
languages other than English.
1 Introduction
It is standard practice to distinguish foreign words and expressions via the use of
italics. The commands defined in this package are intended to aid in rendering
this automatic and switchable; the default font change is emphasis via \emph.
With regard to punctuation (periods) in abbreviations and the use of different
fonts or typefaces, the choice (more-or-less unavoidably) has been made to exclude
such marks from any font changes; i.e. they always appear in the current default
text font. The problem is due to the presence of periods that may accidentally
coincide with natural sentence-ending full-stops. Since LATEX cannot determine the
actual syntactic rôle of such periods and any method of signalling this externally
would be inevitably cumbersome, the package author has decided on the simplest
course of action.
2 Usage
The call format for the package is
\usepackage[hoptionsi]{foreign},
\defasforeign while the syntax of the most general definition is
\defnotforeign
\redefasforeign
\defasforeign[hforeignphrasei]{hforeign phrasei}.
\redefnotforeign ∗ This file has version number v2.7, and revision date 2012/09/25.
† E-mail: [email protected]
1
The above line defines \foreignphrase to expand as foreign phrase. The optional
argument is used to provide a legal command string when the word or phrase itself
is unsuitable due to the presence of non-alphabetic characters, such as spaces (as
in the example), accents, macros, numbers etc. Thus, to define a single foreign
word a call of the following type is sufficient:
\defasforeign{caveat},
after which \caveat will expand to caveat .
A similar command \defnotforeign allows variation of preset default com-
binations; analogous macros \redefasforeign and \redefnotforeign are also
defined. Note that any necessary capitalised versions must be defined addition-
ally. Note also that trailing spaces are handled automatically via the xspace
package and its \xspace command.
\foreign The two single-argument macros \foreign and \notforeign cause their ar-
\notforeign guments to be typeset in the desired manner. The font used for foreign words and
\foreignfullfont phrases depends on the definition of \foreignfullfont, the default is \emph, but
\foreignabbrfont this may be redefined by the user via \renewcommand\foreignfullfont{.. . }.
Abbreviations are defined using \foreignabbrfont, default \em.
2.1 Options
abbreviations At present there are seven user options, four of which allow a few preset default
xfrench definitions to be activated:
xgerman abbreviations foreign abbreviations,
xlatin xfrench French words and phrases,
phrases xgerman German words and phrases,
all xlatin Latin words and phrases,
phrases non-Latin foreign words and phrases,
all all of the above.
UKenglish The remaining, UKenglish (british is a synonym), allows choosing no comma
british following the abbreviations “i.e.” and “e.g.”; this is the generally recommended
usage in British English. The default, recommended American, usage is to use a
comma (both before and after).
Note that if either the UKenglish or british option is present in the
\documentclass statement (e.g. for the babel package), then the UKenglish
(british) option will be activated in the foreign package.
2
2.3 Caveats
No particular care is necessary in using the commands defined by this package
(they are “robust”). However, it should be noted that the \xspace command
does not generate space when appearing before “{” (even if there is an intervening
space) and therefore in such a case a following “\ ” or \space is required.
3 Implementation
3.1 External packages
Load the xpunctuate∗ and xspace packages, for correct punctuation and trailing
spaces.
1 \RequirePackage{xpunctuate,xspace}
The xspace package is loaded explicitly, despite being loaded by xpunctuate, as
it is also used explicitly here.
3
4 \newcommand\foreignfullfont{\emph}
5 \newcommand\foreignabbrfont{\em}
\defasforeign The macro \defasforeign defines a new command to represent a foreign (e.g.
\defnotforeign italicised) word or phrase. Similarly, \defnotforeign defines a macro to represent
a non-foreign (and therefore non-italicised) word or phrase.
6 \newcommand\defasforeign[2][]{%
7 \define@foreign{#1}{#2}{\newcommand}{\foreign}
8}
9 \newcommand\defnotforeign[2][]{%
10 \define@foreign{#1}{#2}{\newcommand}{\notforeign}
11 }
Note that \defasforeign and \defnotforeign may not be used successively with
the same arguments to reverse their effects; for such a behaviour use the following
naturally defined commands.
4
The following are common Latin words and phrases (which should normally
be italicised):
25 \DeclareOption{xlatin}{%
26 \defasforeign{addendum}
27 \defasforeign{Addendum}
28 \defasforeign[adhoc]{ad hoc}
29 \defasforeign[Adhoc]{Ad hoc}
30 \defasforeign[aposteriori]{a posteriori}
31 \defasforeign[Aposteriori]{A posteriori}
32 \defasforeign[apriori]{a priori}
33 \defasforeign[Apriori]{A priori}
34 \defasforeign{caveat}
35 \defasforeign{Caveat}
36 \defasforeign{circa}
37 \defasforeign{Circa}
38 \defasforeign{curriculum}
39 \defasforeign{Curriculum}
40 \defasforeign{erratum}
41 \defasforeign{Erratum}
42 \defasforeign{ibidem}
43 \defasforeign{Ibidem}
44 \defasforeign{idem}
45 \defasforeign{Idem}
46 \defasforeign{sic}
47 \defasforeign{Sic}
48 \defasforeign[viceversa]{vice versa}
49 \defasforeign[Viceversa]{Vice versa}
50 \defasforeign[vitae]{vit{\ae}}
51 \defasforeign[Vitae]{Vit{\ae}}
52 }
Macros for (commonly used and italicised) French words and phrases:
53 \DeclareOption{xfrench}{%
54 \defasforeign[ala]{\‘{a} la}
55 \defasforeign[Ala]{\‘{A} la}
56 \defasforeign[visavis]{vis \‘{a} vis}
57 \defasforeign[Visavis]{Vis \‘{a} vis}
58 }
Macros for (commonly used and italicised) German words and phrases:
59 \DeclareOption{xgerman}{%
60 \defasforeign{ansatz}
61 \defasforeign{Ansatz}
62 \defasforeign{gedanken}
63 \defasforeign{Gedanken}
64 }
5
67 \DeclareRobustCommand\eg{%
68 \UKUS@comma{{\foreignabbrfont{e}}.{\foreignabbrfont{g}}}}
69 \DeclareRobustCommand\etal{\xperiodafter{{\foreignabbrfont{et al}}}}
70 \DeclareRobustCommand\etc{\xperiodafter{{\foreignabbrfont{etc}}}}
71 \DeclareRobustCommand\etseq{\xperiodafter{{\foreignabbrfont{et seq}}}}
72 \DeclareRobustCommand\ibid{\xperiodafter{{\foreignabbrfont{ibid}}}}
73 \DeclareRobustCommand\ie{%
74 \UKUS@comma{{\foreignabbrfont{i}}.{\foreignabbrfont{e}}}}
75 \DeclareRobustCommand\loccit{%
76 {\foreignabbrfont{loc}}.\ \xperiodafter{{\foreignabbrfont{cit}}}}
77 \DeclareRobustCommand\opcit{%
78 {\foreignabbrfont{op}}.\ \xperiodafter{{\foreignabbrfont{cit}}}}
79 \DeclareRobustCommand\viz{\xperiodafter{{\foreignabbrfont{viz}}}}
80 \DeclareRobustCommand\Cf{\UKUS@comma{{\foreignabbrfont{Cf}}}}
81 \DeclareRobustCommand\Eg{%
82 \UKUS@comma{{\foreignabbrfont{E}}.{\foreignabbrfont{g}}}}
83 \DeclareRobustCommand\Etal{\xperiodafter{{\foreignabbrfont{Et al}}}}
84 \DeclareRobustCommand\Etc{\xperiodafter{{\foreignabbrfont{Etc}}}}
85 \DeclareRobustCommand\Etseq{\xperiodafter{{\foreignabbrfont{Et seq}}}}
86 \DeclareRobustCommand\Ibid{\xperiodafter{{\foreignabbrfont{Ibid}}}}
87 \DeclareRobustCommand\Ie{%
88 \UKUS@comma{{\foreignabbrfont{I}}.{\foreignabbrfont{e}}}}
89 \DeclareRobustCommand\Loccit{%
90 {\foreignabbrfont{Loc}}.\ \xperiodafter{{\foreignabbrfont{cit}}}}
91 \DeclareRobustCommand\Opcit{%
92 {\foreignabbrfont{Op}}.\ \xperiodafter{{\foreignabbrfont{cit}}}}
93 \DeclareRobustCommand\Viz{\xperiodafter{{\foreignabbrfont{Viz}}}}
94 }
The possibility to choose between the standard U.S. (default) and U.K. usages
(comma and no comma respectively following “e.g.” and “i.e.”) is set up here.
95 \newcommand\UKUS@comma{\xperiodafter}
96 \DeclareOption{UKenglish}{\renewcommand\UKUS@comma{\xperiodafter}}
97 \DeclareOption{USenglish}{\renewcommand\UKUS@comma{\xperiodcommaafter}}
98 \ExecuteOptions{USenglish}
6
3.4.4 Final option processing
We may now process the chosen options:
102 \ProcessOptions
Change History
v1.0 mentation . . . . . . . . . . . . . . . . 1
General: first non-public release . . 1 v2.7
v2.5 General: added capitalised abbrevi-
General: first public release . . . . . 1 ations . . . . . . . . . . . . . . . . . . . 1
v2.6
General: minor corrections to docu-
Index
Numbers written in italic refer to the page where the corresponding entry is de-
scribed; numbers underlined refer to the code line of the definition; numbers in
roman refer to the code lines where the entry is used.
7
\etal . . . . . . . . . . . . 69 \ie ............. 73 U
\Etc . . . . . . . . . . . . . 84 UKenglish . . . . . . . . . 2
\etc . . . . . . . . . . . . . 70 L \UKUS@comma 66, 68, 74,
\Etseq . . . . . . . . . . . 85 \Loccit . . . . . . . . . . 89 80, 82, 88, 95–97
\etseq . . . . . . . . . . . 71 \loccit . . . . . . . . . . 75
\ExecuteOptions 98–101
N V
F \notforeign . 2, 2, 10, 16 \Viz . . . . . . . . . . . . . 93
\foreign . . . . 2, 2, 7, 13 \viz . . . . . . . . . . . . . 79
\foreign@csname . . . O
. . . . . . . 19–21, 23 \Opcit . . . . . . . . . . . 91 X
\foreignabbrfont 2, \opcit . . . . . . . . . . . 77 xfrench . . . . . . . . . . . . 2
4, 66, 68–72, 74, xgerman . . . . . . . . . . . 2
76, 78–80, 82– P
phrases . . . . . . . . . . . . 2 xlatin . . . . . . . . . . . . . 2
86, 88, 90, 92, 93
\foreignfullfont 2, 2, 4 \ProcessOptions . . . 102 \xperiodafter . . . . .
. . . . 69–72, 76,
I R 78, 79, 83–86,
\Ibid . . . . . . . . . . . . 86 \redefasforeign . . 1, 12 90, 92, 93, 95, 96
\ibid . . . . . . . . . . . . 72 \redefnotforeign . 1, 12 \xperiodcommaafter . 97
\Ie . . . . . . . . . . . . . 87 \RequirePackage . . . . 1 \xspace . . . . . . . . . 2, 3