summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/eemeir/eemeir.sty
blob: 7dc6a647e444bcba3ad47db05096412e57bb717c (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
%%
%% This is file `eemeir.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% eemeir.dtx  (with options: `package')
%% 
%%  m This is the E-Em-Eir package
%%  o Copyright 2003-07 by Mogens Lemvig Hansen,
%%  g Please find my e-mail address in the left margin
%%  e
%%  n Run eemeir.dtx through LaTeX and read the documentation in eemeir.dvi
%%  s
%%  @ This work may be distributed and/or modified under the
%%  k conditions of the LaTeX Project Public License, either version 1.3
%%  a of this license or (at your option) any later version.
%%  y The latest version of this license is in
%%  j   http://www.latex-project.org/lppl.txt
%%  u and version 1.3 or later is part of all distributions of LaTeX
%%  . version 2003/12/01 or later.
%%  c
%%  o This work has the LPPL maintenance status 'maintained'.
%%  m
%%    The Current Maintainer of this work is Mogens Lemvig Hansen.
%% 
%%    This work consists of the files eemeir.dtx and eemeir.ins
%%    and the derived file eemeir.sty.
%% 
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{eemeir}[2007/02/19 v1.1 E-Em-Eir package]
\newcommand{\@eemeir}{\relax}
\newcommand{\@eemeirM}{\relax}
\newcommand{\@eemeirF}{\relax}
\DeclareOption{male}  {\def\@eemeir{\male[]}}
\DeclareOption{female}{\def\@eemeir{\female[]}}
\DeclareOption{ask}   {\def\@eemeir{\askforgender[]}}
\ExecuteOptions{ask}
\ProcessOptions
\RequirePackage{xspace}
\newcommand{\male}[1][]{%
   \@bsphack
   \@ifundefined{ifmale#1}
      {\expandafter\newif\csname ifmale#1\endcsname}
      {\relax}%
   \csname male#1true\endcsname
   \@esphack}
\newcommand{\female}[1][]{%
   \@bsphack
   \@ifundefined{ifmale#1}
      {\expandafter\newif\csname ifmale#1\endcsname}
      {\relax}%
   \csname male#1false\endcsname
   \@esphack}
\newcommand{\askforgender}[1][]{%
   \@bsphack
   \@ifundefined{ifmale#1}
      {\expandafter\newif\csname ifmale#1\endcsname}
      {\relax}%
   \def\@eemeir{#1}%
   \ifx\@eemeir\@empty\def\@eemeir{main}\fi
   \typein[\@eemeir]{Specify the \@eemeir\space gender:%
      \space\space male\space\space or\space\space female}%
   \def\@eemeirM{male}%
   \def\@eemeirF{female}%
   \ifx\@eemeir\@eemeirM\male[#1]%
   \else\ifx\@eemeir\@eemeirF\female[#1]%
   \else\PackageError{eemeir}
      {I'll ignore that}
      {You should have typed either\space\space male\space\space
         or\space\space female}%
   \fi\fi
   \@esphack
}
\newenvironment{swapgender}[1][]{%
   \@bsphack
   \@ifundefined{ifmale#1}
      {\PackageError{eemeir}{unknown gender: #1}
         {You must set the #1 gender with \string\male\space
            (or...) first.}}
      {\csname ifmale#1\endcsname\csname male#1false\endcsname
       \else\csname male#1true\endcsname\fi}%
   \@esphack}
   {\@bsphack\@Esphack}
\newcommand{\newwordpair}  {\@newwordpair\newcommand}
\newcommand{\renewwordpair}{\@newwordpair\renewcommand}
\newcommand{\@newwordpair}[4]{%
   #1{#2}{\@ifstar
      {\def\@eemeirM{\MakeUppercase#3}%
       \def\@eemeirF{\MakeUppercase#4}%
       \@eemeirword}
      {\def\@eemeirM{#3}%
       \def\@eemeirF{#4}%
       \@eemeirword}}%
}
\newcommand{\@eemeirword}[1][]{%
   \@ifundefined{ifmale#1}
      {\PackageWarning{eemeir}
         {You should set the #1 gender before using\MessageBreak it}%
       \askforgender[#1]}
      {\relax}%
   \csname ifmale#1\endcsname\@eemeirM\else\@eemeirF\fi
   \xspace
}
\newwordpair{\E}{he}{she}
\newwordpair{\Em}{him}{her}
\newwordpair{\Eir}{his}{her}
\newwordpair{\Eirs}{his}{hers}
\@eemeir
\endinput
%%
%% End of file `eemeir.sty'.