blob: 93100aa1f7186d790df3017a2ff976f382215278 (
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
|
% This package implements a version of semi-automatic pronoun switching for writing
% gender-neutral (and possibly annoying) prose.
% The basic code is due to Josef (no last name) and Martin Scharrer on
% http://tex.stackexchange.com/questions/10787/
%
% Modified to handle anaphoric reference to the current gender plus
% all three case forms in both uppercase and lowercase.
% Includes an option to flag to turn off xspace, and a silly option for replacing
% all pronouns with 'they/them/their'.
%
% Copyright 2011, 2013, 2016 by Alan Munn
%
% This package may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or any later version.
% The latest version of this license is in
% http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
%
% This package has the LPPL maintenance status `maintained'.
%
% The Current Maintainer of this package is Alan Munn.
%
% This package consists of the file he-she.sty and documentation files
% he-she.tex and he-she.pdf
%
% Option noxspace
%
% xspace can cause problems if the macro is e.g. enclosed in other markup such
% as \emph{}. The noxspace option turns off the xspace and forces users to
% insert a following space using "\ " explicitly. Default is to enable xspace.
%
% With the default option, the \xspace can be suppressed with the \xspacefalse
% command as needed.
%
% Option they
%
% When you get tired of of alternating genders, you can switch to
% this option, which will replace all of the relevant pronouns with the third
% person plural pronoun form ('they/them/their/theirs'). Note that for the nominative
% this will cause your document to produce ungrammatical text, since there is
% no way to fix the subject/verb agreement.
%
% As a result, this is probably not intended to be a robust alternative!
% You have been warned! (And you will be if you use it too.)
%
% Version history
% Version 1.0 2011/02/13 Initial release.
% Version 1.1 2013/03/04 Added [para] option and reflexive forms.
% Version 1.1b 2013/06/11 Fixed bug with [para] option (thanks to Enrico Gregorio)
% Version 1.2 2016/05/25 Added \hishers, \hers and \hiss commands
% (thanks to Mike Sabin for the feature request)
% Version 1.3 2016/06/06 Added a \setgender command to make choosing the gender more user friendly.
% Documentation rewritten to reflect this change. All internal macros have now been prefixed with HS@
% User level access to the booleans is now through \setgender although the old booleans are emulated
% for backwards compatibility.
% (thanks to Sefarin James for the feature request)
%
\ProvidesPackage{he-she}[2016/06/06 Semi-automatic pronoun switching with anaphora v1.3]
\RequirePackage{xspace}
\newif\ifxspace\xspacetrue
\newif\ifHS@they\HS@theyfalse
\newif\ifHS@para
\DeclareOption{noxspace}{\xspacefalse}
\DeclareOption{they}{%
\HS@theytrue
\PackageWarning{he-she}{*** WARNING: Use of option `\CurrentOption` will screw up subject/verb agreement for most nominative pronouns. It is only present for for its comic value! USE AT YOUR OWN RISK! ***}
}
%
\DeclareOption{para}{
\HS@paratrue
\PackageWarning{he-she}{*** WARNING: Use the `\CurrentOption` at your own risk. With this option you should use *only* the anaphoric versions of the pronouns in your text. ***}}
%
\DeclareOption*{%
\PackageWarning{he-she}{Unknown option `\CurrentOption`}%
}
\ProcessOptions
% toggle for changing the gender
\newif\ifHS@he\HS@hetrue
% macro to get first character of a token
\def\HS@getfirst#1{\HS@fstx#1\empty\empty}
\def\HS@fstx#1#2\empty{%
\edef\HS@fst{#1}}
% macros for comparison
\def\HS@Masc{M}
\def\HS@masc{m}
\def\HS@Fem{F}
\def\HS@fem{f}
% command to set gender (takes Male/M Female/F etc. or lowercase version of each)
% expands argument first to allow it to be a macro
\newcommand\setgender[1]{%
\edef\next{\noexpand\HS@setgender{#1}}\next}
\newcommand\HS@setgender[1]{%
\HS@getfirst{#1}
\ifx\HS@fst\HS@Masc \global\HS@hefalse
\else
\ifx\HS@fst\HS@masc \global\HS@hefalse
\else
\ifx\HS@fst\HS@Fem \global\HS@hetrue
\else
\ifx\HS@fst\HS@fem \global\HS@hetrue
\else
\global\HS@hetrue
\PackageWarning{he-she}{Invalid value for gender. Using Masculine}
\fi
\fi
\fi
\fi
}
%
%
\ifHS@para%
\RequirePackage{everyhook}
\PushPreHook{par}{\makebox[0pt][0pt]{\xspacefalse\heshe}}
\fi
\ifHS@they
% Implement the (somewhat useless) 'they' option
%
\newcommand*{\heshe}{they\ifxspace\xspace\fi}
\newcommand*{\Heshe}{They\ifxspace\xspace\fi}
\newcommand*{\himher}{them\ifxspace\xspace\fi}
\newcommand*{\himherself}{themselves\ifxspace\xspace\fi}
\newcommand*{\Himher}{Them\ifxspace\xspace\fi}
\newcommand*{\Himherself}{Themselves\ifxspace\xspace\fi}
\newcommand*{\hisher}{their\ifxspace\xspace\fi}
\newcommand*{\hishers}{theirs\ifxspace\xspace\fi}
\newcommand*{\Hisher}{Their\ifxspace\xspace\fi}
\newcommand*{\Hishers}{Theirs\ifxspace\xspace\fi}
\newcommand*{\he}{they\ifxspace\xspace\fi}
\newcommand*{\He}{They\ifxspace\xspace\fi}
\newcommand*{\him}{them\ifxspace\xspace\fi}
\newcommand*{\himself}{themselves\ifxspace\xspace\fi}
\newcommand*{\Him}{Them\ifxspace\xspace\fi}
\newcommand*{\Himself}{Themselves\ifxspace\xspace\fi}
\newcommand*{\his}{their\ifxspace\xspace\fi}
\newcommand*{\hiss}{theirs\ifxspace\xspace\fi}
\newcommand*{\His}{Their\ifxspace\xspace\fi}
\newcommand*{\Hiss}{Theirs\ifxspace\xspace\fi}
%
\else
%
% Lowercase versions:
%
% Nominative lowercase switching form \heshe
\newcommand*{\heshe}{%
\leavevmode
\ifHS@he
he%
\global\HS@hefalse%
\else
she%
\global\HS@hetrue%
\fi
\ifxspace\xspace\fi
}
%
% Nominative lowercase anaphoric form \he
\newcommand*\he{%
\leavevmode
\ifHS@he
she%
\else
he%
\fi
\ifxspace\xspace\fi
}
%
% Accusative lowercase switching form \himher
\newcommand*\himher{%
\leavevmode
\ifHS@he
him%
\global\HS@hefalse%
\else
her%
\global\HS@hetrue%
\fi
\ifxspace\xspace\fi
}%
% Lowercase switching reflexive form \himherself
%
\newcommand*\himherself{%
\leavevmode
\ifHS@he
herself%
\else
himself%
\fi
\ifxspace\xspace\fi
}
%
% Accusative lowercase anaphoric form \him
\newcommand*\him{%
\leavevmode
\ifHS@he
her%
\else
him%
\fi
\ifxspace\xspace\fi
}
% Lowercase anaphoric reflexive form \himself
%
\newcommand*\himself{%
\leavevmode
\ifHS@he
herself%
\else
himself%
\fi
\ifxspace\xspace\fi
}
%
% Genitive lowercase switching form \hisher
\newcommand*\hisher{%
\leavevmode
\ifHS@he
his%
\global\HS@hefalse%
\else
her%
\global\HS@hetrue%
\fi
\ifxspace\xspace\fi
}
%
% Genitive lowercase anaphoric form \his
\newcommand*\his{%
\leavevmode
\ifHS@he
her%
\else
his%
\fi
\ifxspace\xspace\fi
}
%
% Genitive null NP form ('The car is his/hers')
% Genitive lowercase switching form \hishers
\newcommand*\hishers{%
\leavevmode
\ifHS@he
his%
\global\HS@hefalse%
\else
hers%
\global\HS@hetrue%
\fi
\ifxspace\xspace\fi
}
%
% Genitive lowercase anaphoric form \hiss
\newcommand*\hiss{%
\leavevmode
\ifHS@he
hers%
\else
his%
\fi
\ifxspace\xspace\fi
}
%
% Uppercase versions:
%
% Nominative uppercase switching form \Heshe
\newcommand*{\Heshe}{%
\leavevmode
\ifHS@he
He%
\global\HS@hefalse%
\else
She%
\global\HS@hetrue%
\fi
\ifxspace\xspace\fi
}
%
% Nominative uppercase anaphoric form \He
\newcommand*\He{%
\leavevmode
\ifHS@he
She%
\else
He%
\fi
\ifxspace\xspace\fi
}
%
% Accusative uppercase switching form \Himher
\newcommand*\Himher{%
\leavevmode
\ifHS@he
Him%
\global\HS@hefalse%
\else
Her%
\global\HS@hetrue%
\fi
\ifxspace\xspace\fi
}%
% Uppercase switching reflexive form \Himherself
%
\newcommand*\Himherself{%
\leavevmode
\ifHS@he
Herself%
\else
Himself%
\fi
\ifxspace\xspace\fi
}
%
% Accusative uppercase anaphoric form \Him
\newcommand*\Him{%
\leavevmode
\ifHS@he
Her%
\else
Him%
\fi
\ifxspace\xspace\fi
}
%
% Uppercase anaphoric reflexive form \Himself
%
\newcommand*\Himself{%
\leavevmode
\ifHS@he
Herself%
\else
Himself%
\fi
\ifxspace\xspace\fi
}
%
% Genitive uppercase switching form \Hisher
\newcommand*\Hisher{%
\leavevmode
\ifHS@he
His%
\global\HS@hefalse%
\else
Her%
\global\HS@hetrue%
\fi
\ifxspace\xspace\fi
}
%
% Genitive uppercase anaphoric form \His
\newcommand*\His{%
\leavevmode
\ifHS@he
Her%
\else
His%
\fi
\ifxspace\xspace\fi
}
% Genitive null NP form ('The car is his/hers')
% Genitive uppercase switching form \Hishers
\newcommand*\Hishers{%
\leavevmode
\ifHS@he
His%
\global\HS@hefalse%
\else
Hers%
\global\HS@hetrue%
\fi
\ifxspace\xspace\fi
}
%
% Genitive uppercase anaphoric form \Hiss
\newcommand*\Hiss{%
\leavevmode
\ifHS@he
Hers%
\else
His%
\fi
\ifxspace\xspace\fi
}
\fi
% Define synonyms
\let\she\he
\let\She\He
\let\her\him
\let\herself\himself
\let\Her\Him
\let\Herself\Himself
\let\hir\his
\let\Hir\His
\let\hers\hiss
\let\Hers\Hiss
% These for backward compatibility to previous versions
\newcommand*\hetrue{\setgender{F}}
\newcommand*\hefalse{\setgender{M}}
\endinput
|