summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/genealogytree/gtrcore.symbols.code.tex
blob: a4587240b8abcb47863aef99ee8b3af02d90727f (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
%% The LaTeX package genealogytree - version 2.00 (2020/06/19)
%% gtrcore.symbols.code.tex: Symbols
%%
%% -------------------------------------------------------------------------------------------
%% Copyright (c) 2013-2020 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
%% -------------------------------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) 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 work has the LPPL maintenance status `author-maintained'.
%%
%% This work consists of all files listed in README
%%
\gtr@set@library@version{2.00}

%%%%%%%%%%%%%%%%%%%%%%%
%% Symbols
%%%%%%%%%%%%%%%%%%%%%%%

% hide from externalization
\let\gtr@tikzpicture\tikzpicture%
\let\endgtr@tikzpicture\endtikzpicture%

\colorlet{gtrsymbol}{black}

\def\gtr@symbol@draw#1{\csname gtr@sym@#1@pic\endcsname}

% Draw every time
\newcommand{\gtrSymbolsSetDraw}[1]{%
  \colorlet{gtrsymbol}{#1}%
  \let\gtr@symbol@core\gtr@symbol@draw%
}

\def\gtr@symbol@copy#1{\copy\csname gtr@sym@#1@box\endcsname}

% Draw once, copy the rest of the time
\newcommand{\gtrSymbolsSetCreate}[1]{%
  \colorlet{gtrsymbol}{#1}%
  \let\gtr@symbol@core\gtr@symbol@copy%
  \gtr@symbol@box@hook%
}

\newcommand{\gtrSymbolsSetCreateSelected}[2]{%
  \colorlet{gtrsymbol}{#1}%
  \let\gtr@symbol@core\gtr@symbol@copy%
  \def\do##1{%
    \begingroup\edef\x{\endgroup\noexpand\setbox\expandonce{\csname gtr@sym@##1@box\endcsname}%
      =\noexpand\color@hbox\expandonce{\csname gtr@sym@##1@pic\endcsname}\noexpand\color@endbox}%
    \x}%
  \docsvlist{#2}%
}

\def\gtr@symbol@print#1{%
  \gtrlistseparator%
  \csuse{gtrsym#1}=\csuse{gtr@sym@#1@text}%
}

\def\gtr@symbol@do#1{\gtr@symbol@print{#1}}
\def\gtr@symbol@dont#1{}
\def\gtr@symbol@record#1{\global\cslet{gtr@sym@#1@print}{\gtr@symbol@do}}


\newcommand*{\gtrSymbolsRecordReset}{%
  \def\do##1{\cslet{gtr@sym@##1@print}{\gtr@symbol@dont}}%
  \dolistloop{\gtr@symbol@list}%
}

\newcommand*{\gtrSymbolsFullLegend}[1][]{%
  \begin{gtrprintlist}{}{\unskip,\ }{\unskip.}{}%
    \def\temp@a{#1}\ifx\temp@a\@empty\else\gtrset{language=#1}\fi%
    \def\gtr@symbol@record##1{}%
    \forlistloop{\gtr@symbol@print}{\gtr@symbol@list}%
  \end{gtrprintlist}%
}

\newcommand*{\gtrSymbolsLegend}[1][]{%
  \begin{gtrprintlist}{}{\unskip,\ }{\unskip.}{}%
    \def\temp@a{#1}\ifx\temp@a\@empty\else\gtrset{language=#1}\fi%
    \def\gtr@symbol@record##1{}%
    \def\do##1{\csuse{gtr@sym@##1@print}{##1}}%
    \dolistloop{\gtr@symbol@list}%
  \end{gtrprintlist}%
}

\def\gtr@symbol@core#1#2{%
  \expandafter\def\csname gtrsym#1\endcsname{\gtr@symbol@record{#1}#2}%
  \begingroup\edef\x{\endgroup\noexpand\gtrset{symlang/#1/.store in=\expandonce{\csname gtr@sym@#1@text\endcsname}}}\x%
  \cslet{gtr@sym@#1@print}{\gtr@symbol@dont}%
  \listeadd{\gtr@symbol@list}{#1}%
}

\def\gtr@symbol@factory#1#2#3{%
  \expandafter\newbox\csname gtr@sym@#1@box\endcsname%
  \expandafter\def\csname gtr@sym@#1@pic\endcsname{#2}%
  \gtr@symbol@core{#1}{%
    \edef\gtr@scale{\strip@pt\dimexpr#3\dimexpr\f@size pt\relax}%
    \scalebox{\gtr@scale}{\gtr@symbol@core{#1}}}%
  \eappto\gtr@symbol@box@hook{\noexpand\setbox\expandonce{\csname gtr@sym@#1@box\endcsname}%
    =\noexpand\color@hbox\expandonce{\csname gtr@sym@#1@pic\endcsname}\noexpand\color@endbox}%
}

\gtr@symbol@factory{Born}{%
  \begin{gtr@tikzpicture}[line width=4mm,color=gtrsymbol]%
    \path[use as bounding box] (-1.1,-0.926574) rectangle (1.1,1);
    \draw (0,0)--(18:1cm);
    \draw (0,0)--(90:1cm);
    \draw (0,0)--(162:1cm);
    \draw (0,0)--(234:1cm);
    \draw (0,0)--(306:1cm);
  \end{gtr@tikzpicture}%
}{0.012}

\gtr@symbol@core{Bornoutofwedlock}{%
  \textcolor{gtrsymbol}{\normalfont\sffamily(\kern-.125em{\def\gtr@symbol@record##1{}\gtrsymBorn}\kern-.125em)}%
}

\gtr@symbol@core{Stillborn}{{\def\gtr@symbol@record##1{}\gtrsymDied\gtrsymBorn}}

\gtr@symbol@core{Diedonbirthday}{\textcolor{gtrsymbol}{{\def\gtr@symbol@record##1{}\gtrsymBorn\gtrsymDied}}}

\gtr@symbol@factory{Baptized}{%
  \begin{gtr@tikzpicture}[line width=4mm,xscale=0.5,baseline=-7mm,color=gtrsymbol]%
    \path[use as bounding box] (-0.45,-0.5) rectangle (6.45,1.5);
    \draw (0,0) .. controls (0.5,0.4) and (1.5,0.4) .. (2,0) .. controls (2.5,-0.4) and (3.5,-0.4) .. (4,0) .. controls (4.5,0.4) and (5.5,0.4) .. (6,0);
    \draw (0,1) .. controls (0.5,1.4) and (1.5,1.4) .. (2,1) .. controls (2.5,0.6) and (3.5,0.6) .. (4,1) .. controls (4.5,1.4) and (5.5,1.4) .. (6,1);
  \end{gtr@tikzpicture}%
}{0.009}%

\gtr@symbol@factory{Engaged}{%
  \begin{gtr@tikzpicture}[line width=3mm,color=gtrsymbol]%
    \path[use as bounding box] (-1.15,-1.05) rectangle (1.15,1.05);
    \draw (0,0) circle (9mm);
  \end{gtr@tikzpicture}%
}{0.011}%

\gtr@symbol@factory{Married}{%
  \begin{gtr@tikzpicture}[line width=3mm,color=gtrsymbol]%
    \path[use as bounding box] (-1.65,-1.05) rectangle (1.65,1.05);
    \draw (-0.50,0) +(-40:9mm) arc (-40:285:9mm);
    \draw (0.50,0) +(-220:9mm) arc (-220:105:9mm);
  \end{gtr@tikzpicture}%
}{0.011}%

\gtr@symbol@factory{Divorced}{%
  \begin{gtr@tikzpicture}[line width=3mm,color=gtrsymbol]%
    \path[use as bounding box] (-2.35,-1.05) rectangle (2.35,1.05);
    \draw (-1.2,0) circle (9mm);
    \draw (0,-0.9)--(0,0.9);
    \draw (1.2,0) circle (9mm);
  \end{gtr@tikzpicture}%
}{0.011}%

\gtr@symbol@factory{Partnership}{%
  \begin{gtr@tikzpicture}[line width=3mm,color=gtrsymbol]%
    \path[use as bounding box] (-2.65,-1.05) rectangle (2.65,1.05);
    \draw (-1.5,0) circle (9mm);
    \draw (-0.5,0)--(0.5,0);
    \draw (1.5,0) circle (9mm);
  \end{gtr@tikzpicture}%
}{0.011}%

\gtr@symbol@factory{Floruit}{%
  \begin{gtr@tikzpicture}[line width=4mm,rounded corners,color=gtrsymbol]%
    \path[use as bounding box] (-1.05,-1) rectangle (1.05,0.85);
    \draw (54:5mm)--(54:8mm);
    \draw (126:5mm)--(126:8mm);
    \draw (198:5mm)--(198:8mm);
    \draw (270:5mm)--(270:8mm);
    \draw (342:5mm)--(342:8mm);
    \fill (0,0) circle (2mm);
    \fill (54:8mm) circle (2mm);
    \fill (126:8mm) circle (2mm);
    \fill (198:8mm) circle (2mm);
    \fill (270:8mm) circle (2mm);
    \fill (342:8mm) circle (2mm);
  \end{gtr@tikzpicture}%
}{0.012}%

\gtr@symbol@factory{Died}{%
  \begin{gtr@tikzpicture}[line width=4mm,baseline=2mm,color=gtrsymbol]%
    \path[use as bounding box] (-0.8,0) rectangle +(1.6,2.2);
    \draw (0,0)--(0,2.2);
    \draw (-0.7,1.5)--+(1.4,0);
  \end{gtr@tikzpicture}%
}{0.012}%

\gtr@symbol@factory{Killed}{%
  \begin{gtr@tikzpicture}[line width=2mm,baseline=1mm,color=gtrsymbol]%
    \path[use as bounding box] (-0.94,-0.08) rectangle (0.94,1.9);
    \foreach \v in {,-}
    {
      \begin{scope}[xshift=\v7mm,rotate=\v40]
      \fill (-0.1,0) [rounded corners=0.5mm] -- (-0.1,1.8) -- (0,2.5)
          -- (0.1,1.8)[sharp corners] -- (0.1,0) -- cycle;
      \draw (-0.4,0.4) -- (0.4,0.4);
      \end{scope}
    }
  \end{gtr@tikzpicture}%
}{0.0133}%

\gtr@symbol@factory{Buried}{%
  \begin{gtr@tikzpicture}[line width=3mm,baseline=2mm,color=gtrsymbol]%
    \path[use as bounding box] (-0.86,-.15) rectangle (0.86,2.35);
    \draw[draw,fill,fill opacity=0.25] (-0.3,0) -- (-0.6,1.5) -- (-0.3,2.2) -- (0.3,2.2) -- (0.6,1.5) -- (0.3,0) -- cycle;
  \end{gtr@tikzpicture}%
}{0.011}%

\gtr@symbol@factory{Funeralurn}{%
  \begin{gtr@tikzpicture}[line width=2mm,,color=gtrsymbol]%
    \path[use as bounding box] (-0.78,-0.1) rectangle (0.78,1.9);
    \path[fill,fill opacity=0.25] (-0.3,0) -- (-0.6,1.2) -- (0.6,1.2) -- (0.3,0) -- cycle;
    \path[draw] (-0.3,0)[rounded corners=2mm] -- (-0.6,1.2)[sharp corners] -- (-0.3,1.6) --
          (0.3,1.6)[rounded corners=2mm] -- (0.6,1.2)[sharp corners] -- (0.3,0) -- cycle;
    \fill (0,1.7) circle (2mm);
  \end{gtr@tikzpicture}%
}{0.011}%

\gtr@symbol@factory{Female}{%
  \begin{gtr@tikzpicture}[line width=2mm,baseline=-13mm,color=gtrsymbol]%
    \path[use as bounding box] (-0.9,-1.8) rectangle (0.9,0.8);
    \draw (0,0) circle (7mm);
    \draw (270:7mm) -- (270:18mm);
    \draw (-0.4,-1.3)--(0.4,-1.3);
  \end{gtr@tikzpicture}%
}{0.011}%

\gtr@symbol@factory{Male}{%
  \begin{gtr@tikzpicture}[line width=2mm,color=gtrsymbol]%
    \path[use as bounding box] (-0.9,-0.8) rectangle (1.33,1.28);
    \draw (0,0) circle (7mm);
    \draw[arrows = {-Straight Barb[]}] (45:7mm) -- (45:18mm);
  \end{gtr@tikzpicture}%
}{0.011}%

\gtr@symbol@factory{Neuter}{%
  \begin{gtr@tikzpicture}[line width=2mm,baseline=-13mm,color=gtrsymbol]%
    \path[use as bounding box] (-0.9,-1.8) rectangle (0.9,0.8);
    \draw (0,0) circle (7mm);
    \draw (270:7mm) -- (270:18mm);
  \end{gtr@tikzpicture}%
}{0.011}%

\gtrset{%
  symbols record reset/.code={\gtrSymbolsRecordReset},
  symbols record reset
}

\AtBeginDocument{%
  \gtrSymbolsSetCreate{gtrsymbol}}