summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/he-she/he-she.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/he-she/he-she.sty')
-rw-r--r--Master/texmf-dist/tex/latex/he-she/he-she.sty255
1 files changed, 186 insertions, 69 deletions
diff --git a/Master/texmf-dist/tex/latex/he-she/he-she.sty b/Master/texmf-dist/tex/latex/he-she/he-she.sty
index a3f2f03a626..93100aa1f71 100644
--- a/Master/texmf-dist/tex/latex/he-she/he-she.sty
+++ b/Master/texmf-dist/tex/latex/he-she/he-she.sty
@@ -8,7 +8,7 @@
% Includes an option to flag to turn off xspace, and a silly option for replacing
% all pronouns with 'they/them/their'.
%
-% Copyright 2011 by Alan Munn
+% 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
@@ -36,9 +36,9 @@
%
% Option they
%
-% When you get tired of the silliness of alternating genders, you can switch to
+% 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'). Note that for the nominative
+% 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.
%
@@ -48,8 +48,16 @@
% Version history
% Version 1.0 2011/02/13 Initial release.
% Version 1.1 2013/03/04 Added [para] option and reflexive forms.
-%
-\ProvidesPackage{he-she}[2013/03/04 Semi-automatic pronoun switching with anaphora v1.1]
+% 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
@@ -62,14 +70,48 @@
%
\DeclareOption{para}{
\HS@paratrue
- \PackageWarning{he-she}{*** WARNING: Use the `\CurrentOption` at your own risk. ***}}
+ \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\ifhe\hetrue
+\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%
@@ -86,15 +128,19 @@
\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*{\Him}{Themselves\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
%
@@ -102,21 +148,23 @@
%
% Nominative lowercase switching form \heshe
\newcommand*{\heshe}{%
- \ifhe%
+ \leavevmode
+ \ifHS@he
he%
- \global\hefalse%
- \else%
+ \global\HS@hefalse%
+ \else
she%
- \global\hetrue%
- \fi%
+ \global\HS@hetrue%
+ \fi
\ifxspace\xspace\fi
}
%
% Nominative lowercase anaphoric form \he
\newcommand*\he{%
-\ifhe%
- she%
- \else%
+ \leavevmode
+ \ifHS@he
+ she%
+ \else
he%
\fi
\ifxspace\xspace\fi
@@ -124,21 +172,23 @@
%
% Accusative lowercase switching form \himher
\newcommand*\himher{%
- \ifhe%
+ \leavevmode
+ \ifHS@he
him%
- \global\hefalse%
- \else%
+ \global\HS@hefalse%
+ \else
her%
- \global\hetrue%
- \fi%
+ \global\HS@hetrue%
+ \fi
\ifxspace\xspace\fi
}%
% Lowercase switching reflexive form \himherself
%
\newcommand*\himherself{%
-\ifhe%
- herself%
- \else%
+ \leavevmode
+ \ifHS@he
+ herself%
+ \else
himself%
\fi
\ifxspace\xspace\fi
@@ -146,9 +196,10 @@
%
% Accusative lowercase anaphoric form \him
\newcommand*\him{%
-\ifhe%
- her%
- \else%
+ \leavevmode
+ \ifHS@he
+ her%
+ \else
him%
\fi
\ifxspace\xspace\fi
@@ -156,9 +207,10 @@
% Lowercase anaphoric reflexive form \himself
%
\newcommand*\himself{%
-\ifhe%
- herself%
- \else%
+ \leavevmode
+ \ifHS@he
+ herself%
+ \else
himself%
\fi
\ifxspace\xspace\fi
@@ -166,21 +218,48 @@
%
% Genitive lowercase switching form \hisher
\newcommand*\hisher{%
- \ifhe%
+ \leavevmode
+ \ifHS@he
his%
- \global\hefalse%
- \else%
+ \global\HS@hefalse%
+ \else
her%
- \global\hetrue%
- \fi%
+ \global\HS@hetrue%
+ \fi
\ifxspace\xspace\fi
}
%
% Genitive lowercase anaphoric form \his
\newcommand*\his{%
-\ifhe%
- her%
- \else%
+ \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
@@ -190,21 +269,23 @@
%
% Nominative uppercase switching form \Heshe
\newcommand*{\Heshe}{%
- \ifhe%
+ \leavevmode
+ \ifHS@he
He%
- \global\hefalse%
- \else%
+ \global\HS@hefalse%
+ \else
She%
- \global\hetrue%
- \fi%
+ \global\HS@hetrue%
+ \fi
\ifxspace\xspace\fi
}
%
% Nominative uppercase anaphoric form \He
\newcommand*\He{%
-\ifhe%
- She%
- \else%
+ \leavevmode
+ \ifHS@he
+ She%
+ \else
He%
\fi
\ifxspace\xspace\fi
@@ -212,32 +293,35 @@
%
% Accusative uppercase switching form \Himher
\newcommand*\Himher{%
- \ifhe%
+ \leavevmode
+ \ifHS@he
Him%
- \global\hefalse%
- \else%
+ \global\HS@hefalse%
+ \else
Her%
- \global\hetrue%
- \fi%
+ \global\HS@hetrue%
+ \fi
\ifxspace\xspace\fi
}%
% Uppercase switching reflexive form \Himherself
%
\newcommand*\Himherself{%
-\ifhe%
- Herself%
- \else%
- Himself%
+ \leavevmode
+ \ifHS@he
+ Herself%
+ \else
+ Himself%
\fi
\ifxspace\xspace\fi
}
%
% Accusative uppercase anaphoric form \Him
\newcommand*\Him{%
-\ifhe%
- Her%
- \else%
+ \leavevmode
+ \ifHS@he
+ Her%
+ \else
Him%
\fi
\ifxspace\xspace\fi
@@ -246,9 +330,10 @@
% Uppercase anaphoric reflexive form \Himself
%
\newcommand*\Himself{%
-\ifhe%
- Herself%
- \else%
+ \leavevmode
+ \ifHS@he
+ Herself%
+ \else
Himself%
\fi
\ifxspace\xspace\fi
@@ -256,26 +341,53 @@
%
% Genitive uppercase switching form \Hisher
\newcommand*\Hisher{%
- \ifhe%
+ \leavevmode
+ \ifHS@he
His%
- \global\hefalse%
- \else%
+ \global\HS@hefalse%
+ \else
Her%
- \global\hetrue%
- \fi%
+ \global\HS@hetrue%
+ \fi
\ifxspace\xspace\fi
}
%
% Genitive uppercase anaphoric form \His
\newcommand*\His{%
-\ifhe%
- Her%
- \else%
+ \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
@@ -284,4 +396,9 @@
\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 \ No newline at end of file