summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/genealogytree/gtrcore.options.code.tex
blob: 592ac1ea5416a331f19a01346cf93831392adff8 (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
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
%% The LaTeX package genealogytree - version 2.1.0 (2021/09/20)
%% gtrcore.options.code.tex: Options
%%
%% -------------------------------------------------------------------------------------------
%% Copyright (c) 2013-2021 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.1.0}

%%%%%%%%%%%%%%%%%%%%%%%
%% General handling
%%%%%%%%%%%%%%%%%%%%%%%

% #1 macro
% #2 key list to append
\newrobustcmd{\gtrkeysappto}[2]{%
  \ifdefvoid{#1}%
    {\edef#1{\unexpanded{#2}}}%
    {\edef#1{\expandonce#1,\unexpanded{#2}}}}


% #1 macro
% #2 key list to append (global)
\newrobustcmd{\gtrkeysgappto}[2]{%
  \ifdefvoid{#1}%
    {\xdef#1{\unexpanded{#2}}}%
    {\xdef#1{\expandonce#1,\unexpanded{#2}}}}


% #1 key
% #2 key list to append
\newrobustcmd{\gtr@keys@addvalue}[2]{%
  \pgfkeysifdefined{#1}{%
    \pgfkeysgetvalue{#1}{\gtr@temp}%
    \edef\gtr@temp{\noexpand\pgfkeyssetvalue{#1}{\expandonce\gtr@temp,\unexpanded{#2}}}%
    \gtr@temp%
  }{%
    \pgfkeyssetvalue{#1}{#2}%
  }%
}


% #1 command sequence
% #2 is a macro containing keys
\def\gtr@cs@storekey#1#2{%
  \ifdefvoid{#2}{}{\cslet{#1}{#2}}%
}

% #1 command sequence
% #2 #3 are macros containing keys
\def\gtr@cs@storekeys#1#2#3{%
  \ifdefvoid{#2}{%
    \ifdefvoid{#3}{}{\cslet{#1}{#3}}%
  }{%
    \ifdefvoid{#3}{%
      \cslet{#1}{#2}%
    }{%
      \csedef{#1}{\expandonce#2,\expandonce#3}%
    }%
  }%
}


% set keys from command sequence #1
\newrobustcmd*{\gtr@cs@keysalsofrom}[1]{%
  \letcs\gtr@temp{#1}%
  \ifdefvoid{\gtr@temp}{}{\pgfkeysalsofrom{\gtr@temp}}%
}


% set keys from stored key #1
\newrobustcmd*{\gtr@key@keysalsofrom}[1]{%
  \pgfkeysifdefined{#1}{%
    \pgfkeysgetvalue{#1}{\gtr@temp}%
    \pgfkeysalsofrom{\gtr@temp}%
  }{}%
}


%%%%%%%%%%%%%%%%%%%%%%%
%% Key Management
%%%%%%%%%%%%%%%%%%%%%%%


\ExplSyntaxOn


\cs_new:Npn \getree_set_options_for_subtree:nn #1#2
  {
    \clist_set:Nn \l_tmpa_clist { #1 }
    \clist_map_inline:Nn \l_tmpa_clist
      {
        \gtr@keys@addvalue{/gtr/sopt/##1}{subtree={#2}}
      }
  }


\cs_new:Npn \getree_set_options_for_family:nn #1#2
  {
    \clist_set:Nn \l_tmpa_clist { #1 }
    \clist_map_inline:Nn \l_tmpa_clist
      {
        \gtr@keys@addvalue{/gtr/sopt/##1}{family={#2}}
      }
  }


\cs_new:Npn \getree_set_options_for_node:nn #1#2
  {
    \clist_set:Nn \l_tmpa_clist { #1 }
    \clist_map_inline:Nn \l_tmpa_clist
      {
        \gtr@keys@addvalue{/gtr/nopt/##1}{#2}
      }
  }


\NewDocumentCommand{\gtrsetoptionsforsubtree}{ m +m }
  {
    \getree_set_options_for_subtree:nn {#1}{#2}
  }


\NewDocumentCommand{\gtrsetoptionsforfamily}{ m +m }
  {
    \getree_set_options_for_family:nn {#1}{#2}
  }


\NewDocumentCommand{\gtrsetoptionsfornode}{ m +m }
  {
    \getree_set_options_for_node:nn {#1}{#2}
  }


\NewDocumentCommand{\gtrignoresubtree}{ m }
  {
    \clist_set:Nn \l_tmpa_clist { #1 }
    \clist_map_inline:Nn \l_tmpa_clist
      {
        \gtr@keys@addvalue{/gtr/sopt/##1}{ignore}
      }
  }


\NewDocumentCommand{\gtrignorenode}{ m }
  {
    \getree_set_options_for_node:nn{#1}{ignore}
  }


\gtrset{
  options~for~subtree/.code~n~args={2}{\getree_set_options_for_subtree:nn{#1}{#2}},
  options~for~family/.code~n~args={2}{\getree_set_options_for_family:nn{#1}{#2}},
  options~for~node/.code~n~args={2}{\getree_set_options_for_node:nn{#1}{#2}},
  %
  ignore~subtree/.code={\gtrignoresubtree{#1}},
  ignore~node/.code={\gtrignorenode{#1}},
}

\ExplSyntaxOff



\def\gtr@set@level@position@down#1{%
  \csdimdef{gtr@per@#1@y}{\gtr@level@reference}%
  \csdimdef{gtr@per@#1@dim}{\wd\csuse{gtr@per@#1@box}}%
}

\def\gtr@set@level@position@up#1{%
  \csdimdef{gtr@per@#1@y}{-\gtr@level@reference}%
  \csdimdef{gtr@per@#1@dim}{\wd\csuse{gtr@per@#1@box}}%
}

\def\gtr@set@level@position@left#1{%
  \csdimdef{gtr@per@#1@x}{\gtr@level@reference}%
  \csdimdef{gtr@per@#1@dim}{\ht\csuse{gtr@per@#1@box}+\dp\csuse{gtr@per@#1@box}}%
}

\def\gtr@set@level@position@right#1{%
  \csdimdef{gtr@per@#1@x}{-\gtr@level@reference}%
  \csdimdef{gtr@per@#1@dim}{\ht\csuse{gtr@per@#1@box}+\dp\csuse{gtr@per@#1@box}}%
}

\gtrset{%
  reset edge level shift/.code={%
    \def\gtr@set@position@family@down##1{%
      \csdimdef{gtr@fam@##1@pos}{\gtr@level@reference-\gtr@level@size-\csuse{gtr@fam@##1@frac}\dimexpr\gtr@level@distance}%
    }%
    \def\gtr@set@position@family@up##1{%
      \csdimdef{gtr@fam@##1@pos}{-\gtr@level@reference+\gtr@level@size+\csuse{gtr@fam@##1@frac}\dimexpr\gtr@level@distance}%
    }%
    \let\gtr@set@position@family@left=\gtr@set@position@family@down%
    \let\gtr@set@position@family@right=\gtr@set@position@family@up%
  },
  nullify edge level shift/.code={%
    \def\gtr@set@position@family@down##1{%
      \csdimdef{gtr@fam@##1@pos}{\gtr@level@reference-\gtr@level@size-0.5\dimexpr\gtr@level@distance}%
    }%
    \def\gtr@set@position@family@up##1{%
      \csdimdef{gtr@fam@##1@pos}{-\gtr@level@reference+\gtr@level@size+0.5\dimexpr\gtr@level@distance}%
    }%
    \let\gtr@set@position@family@left=\gtr@set@position@family@down%
    \let\gtr@set@position@family@right=\gtr@set@position@family@up%
  },
  switch edge level shift/.code={%
    \def\gtr@set@position@family@down##1{%
      \csdimdef{gtr@fam@##1@pos}{\gtr@level@reference-\gtr@level@size-\gtr@level@distance+\csuse{gtr@fam@##1@frac}\dimexpr\gtr@level@distance}%
    }%
    \def\gtr@set@position@family@up##1{%
      \csdimdef{gtr@fam@##1@pos}{-\gtr@level@reference+\gtr@level@size+\gtr@level@distance-\csuse{gtr@fam@##1@frac}\dimexpr\gtr@level@distance}%
    }%
    \let\gtr@set@position@family@left=\gtr@set@position@family@down%
    \let\gtr@set@position@family@right=\gtr@set@position@family@up%
  },
}

\newif\ifgtr@timeflow@vertical

\def\gtr@init@timeflow@down{%
  \gtr@timeflow@verticaltrue%
  \let\gtrNodeMinWidth=\gtr@node@minsize%
  \let\gtrNodeMaxWidth=\gtr@node@maxsize%
  \let\gtrNodeMinHeight=\gtr@level@size%
  \let\gtrNodeMaxHeight=\gtr@level@size%
}

\let\gtr@init@timeflow@up=\gtr@init@timeflow@down

\def\gtr@init@timeflow@left{%
  \gtr@timeflow@verticalfalse%
  \let\gtrNodeMinWidth=\gtr@level@size%
  \let\gtrNodeMaxWidth=\gtr@level@size%
  \let\gtrNodeMinHeight=\gtr@node@minsize%
  \let\gtrNodeMaxHeight=\gtr@node@maxsize%
}

\let\gtr@init@timeflow@right=\gtr@init@timeflow@left

\newif\ifgtr@ignore

\gtrset{%
  id prefix/.store in=\gtrkv@idprefix,
  id suffix/.store in=\gtrkv@idsuffix,
  id/.code={\xdef\gtr@gkv@id{\expandonce\gtrkv@idprefix\unexpanded{#1}\expandonce\gtrkv@idsuffix}},
  distance/.gstore in=\gtr@gkv@distance,
  tikz/.gstore in=\gtr@gkv@tikz,
  pivot@@value/.gstore in=\gtr@gkv@pivot,
  pivot@none/.style={pivot@@value=0},
  pivot@child/.style={pivot@@value=1},
  pivot@parent/.style={pivot@@value=2},
  pivot@both/.style={pivot@@value=3},
  pivot/.style={pivot@#1},
  pivot/.default={both},
  pivot shift/.gstore in=\gtr@gkv@pivotshift,
  %
  ignore/.is choice,
  ignore/true/.code={\global\gtr@ignoretrue},
  ignore/false/.code={\global\gtr@ignorefalse},
  ignore/.default=true,
  %
  insert after node/.code n args={2}{%
    \gtr@parse@init@hook{gtr@parse@afternode@hook}{gtr@per@\gtr@currentperson @id}%
    \gtr@parse@appto@hook{gtr@parse@afternode@hook}{#1}{#2}%
  },
  insert after family/.code n args={2}{%
    \gtr@parse@init@hook{gtr@parse@afterfamily@hook}{gtr@fam@\gtr@lastfamily @id}%
    \gtr@parse@appto@hook{gtr@parse@afterfamily@hook}{#1}{#2}%
  },
  insert at begin family/.code n args={2}{%
    \gtr@parse@init@hook{gtr@parse@beginfamily@hook}{gtr@fam@\gtr@currentfamily @id}%
    \gtr@parse@appto@hook{gtr@parse@beginfamily@hook}{#1}{#2}%
  },
  insert at end family/.code n args={2}{%
    \gtr@parse@init@hook{gtr@parse@endfamily@hook}{gtr@fam@\gtr@currentfamily @id}%
    \gtr@parse@appto@hook{gtr@parse@endfamily@hook}{#1}{#2}%
  },
  insert for childless families level limit/.store in=\gtr@childlesschild@levellimit,
  insert for childless families/.code={%
    \ifblank{#1}%
      {\def\gtr@parse@childlesschild@hook{}}%
      {\long\def\gtr@parse@childlesschild@hook{%
        \ifnum\gtr@c@level>\gtr@childlesschild@levellimit\relax%
          \ifcsundef{gtr@fam@\gtr@currentfamily @patchi}{\gtr@parse@graph #1x}{}%
        \fi%
      }}%
  },
  insert phantom for childless families/.style={insert for childless families={c[phantom]{}}},
  %
  family/.style={#1},
  subtree/.style={#1},
  node/.style={#1},
  %
  box/.code={\gtrkeysappto\gtrNodeBoxOptions{#1}},
  box clear/.code={\def\gtrNodeBoxOptions{}},
  %
  node box/.style={node={box={#1}}},
  family box/.style={family={box={#1}}},
  subtree box/.style={subtree={box={#1}}},
  %
  label/.store in=\gtrkv@family@label,
  family label/.style={family={label={#1}}},
  subtree label/.style={subtree={label={#1}}},
  label options/.store in=\gtrkv@family@label@options,
  label database options/.store in=\gtrkv@database@label,
  ignore family database/.style={family@database/.code=},
  use family database/.style={family@database/.code={%
    \gtrset{database/.cd,db@reset,##1}%
    \gtrOptionsDatabase%
    \gtrset{label={\gtrPrintDatabase}}%
  }},
  family database/.style={family={family@database={#1}}},
  %
  node processor/.code={\let\gtr@box@content@processor=#1},
  processing/.is choice,%
  %
  time@flow/.store in=\gtrkv@timeflow,
  timeflow/.is choice,
  timeflow/down/.style={time@flow=down},
  timeflow/up/.style={time@flow=up},
  timeflow/left/.style={time@flow=left},
  timeflow/right/.style={time@flow=right},
  %
  level distance/.dimstore in=\gtr@@kv@@gtr@level@distance,
  level size/.dimstore in=\gtr@@kv@@gtr@level@size,
  node size from/.code args={#1 to #2}{\dimdef\gtr@@kv@@gtr@node@minsize{#1}\dimdef\gtr@@kv@@gtr@node@maxsize{#2}},
  node size/.code={\dimdef\gtr@@kv@@gtr@node@minsize{#1}\dimdef\gtr@@kv@@gtr@node@maxsize{#1}},%
  child distance in parent graph/.dimstore in=\gtr@@kv@@gtr@dist@sibling@par,%
  child distance in child graph/.dimstore in=\gtr@@kv@@gtr@dist@sibling@chi,%
  parent distance in parent graph/.dimstore in=\gtr@@kv@@gtr@dist@parent@par,%
  parent distance in child graph/.dimstore in=\gtr@@kv@@gtr@dist@parent@chi,%
  further distance/.dimstore in=\gtr@@kv@@gtr@dist@further,%
  %
  child distance/.style={child distance in parent graph=#1,child distance in child graph=#1},%
  parent distance/.style={parent distance in parent graph=#1,parent distance in child graph=#1},%
  %
  proband level/.store in=\gtrkv@proband@level,
  tree offset/.store in=\gtrkv@tree@offset,
  after parser/.code={\gappto\gtrkv@after@parser{#1}},
  add child/.code args={#1 to #2}{\gappto\gtrkv@after@parser{\gtr@add@child@after@parser{#1}{#2}}},%
  add parent/.code args={#1 to #2}{\gappto\gtrkv@after@parser{\gtr@add@parent@after@parser{#1}{#2}}},%
  remove child/.code args={#1 from #2}{\gappto\gtrkv@after@parser{\gtr@remove@child@after@parser{#1}{#2}}},%
  remove parent/.code args={#1 from #2}{\gappto\gtrkv@after@parser{\gtr@remove@parent@after@parser{#1}{#2}}},%
  disconnect/.is choice,
  disconnect/child/.code={%
    \ifdefvoid{\gtr@currentperson}{}{%
      \begingroup\edef\x{\endgroup\noexpand\gappto\noexpand\gtrkv@after@parser{%
        \noexpand\gtr@disconnect@node@as@child{\gtr@currentperson}%
      }}\x%
    }%
  },
  disconnect/parent/.code={%
    \ifdefvoid{\gtr@currentperson}{}{%
      \begingroup\edef\x{\endgroup\noexpand\gappto\noexpand\gtrkv@after@parser{%
        \noexpand\gtr@disconnect@node@as@parent{\gtr@currentperson}%
      }}\x%
    }%
  },
  disconnect/both/.code={%
    \ifdefvoid{\gtr@currentperson}{}{%
      \begingroup\edef\x{\endgroup\noexpand\gappto\noexpand\gtrkv@after@parser{%
        \noexpand\gtr@disconnect@node@as@child{\gtr@currentperson}%
        \noexpand\gtr@disconnect@node@as@parent{\gtr@currentperson}%
      }}\x%
    }%
  },
  disconnect/.default=both,
  %
  ignore level/.code={%
    \ifnum#1>0\relax%
      \gtrset{level #1/.style={node=ignore}}%
      \edef\gtrtemp{\the\numexpr#1+1\relax}%
      \gtrset{level \gtrtemp/.style=ignore}%
    \else\ifnum#1<0\relax%
      \gtrset{level #1/.style={ignore,node=ignore}}%
    \fi\fi%
  },
  ignore parent childs/.code={\let\gtr@parent@@c\gtr@parent@@c@ignore},
  %
  edges/.code={\gtredgeset{#1}},
  family edges/.style={family={edges={#1}}},
  edges for family/.style 2 args={options for family={#1}{edges={#2}}},
  subtree edges/.style={subtree={edges={#1}}},
  edges for subtree/.style 2 args={options for subtree={#1}{edges={#2}}},
  %
  tikzpicture/.store in=\gtrkv@tikzpicture,
  after tree/.code={\appto\gtrkv@after@tree{#1}},
  tikzset/.code={\def\gtrkv@tikzset{\tikzset{#1}}},
  tcbset/.code={\def\gtrkv@tcbset{\tcbset{#1}}},
  %
  extra edges/.code={\listadd{\gtr@extra@edges@app}{#1}},
  extra edges prepend/.code={\listadd{\gtr@extra@edges@pre}{#1}},
  family extra edges/.style n args={3}{family={extra edges={#1}{#2}{#3}}},
  family extra edges prepend/.style n args={3}{family={extra edges prepend={#1}{#2}{#3}}},
  extra edges for family/.style n args={4}{options for family={#1}{extra edges={#2}{#3}{#4}}},
  extra edges prepend for family/.style n args={4}{options for family={#1}{extra edges prepend={#2}{#3}{#4}}},
  extra edges for families/.style 2 args={%
    x/.style n args={3}{extra edges for family={##1}{##2}{##3}{#2}},%
    #1},
  extra edges prepend for families/.style 2 args={%
    x/.style n args={3}{extra edges prepend for family={##1}{##2}{##3}{#2}},%
    #1},
  %
  edges@shift@down/.style={family edges={yshift=#1}},
  edges@shift@up/.style={family edges={yshift=-#1}},
  edges@shift@left/.style={family edges={xshift=#1}},
  edges@shift@right/.style={family edges={xshift=-#1}},
  edges shift/.style={edges@shift@\gtr@timeflow={#1}},
  edges up/.style={edges shift=\gtr@level@distance/3},
  edges down/.style={edges shift=-\gtr@level@distance/3},
  edges up by/.style args={#1 of #2}{edges shift=#1\dimexpr\gtr@level@distance/#2},
  edges down by/.style args={#1 of #2}{edges shift=-#1\dimexpr\gtr@level@distance/#2},
  %
  phantom*/.style={subtree={processing=tcolorbox,deletion content interpreter,edges=none,
    box={empty,notitle,no underlay,no overlay,no shadow,no borderline,code={\ifstrempty{#1}{}{%
      \ifgtr@timeflow@vertical\tcbset{width=#1}\else\tcbset{height=#1}\fi%
      }}}}},
  phantom*/.default=,
  phantom/.style={phantom*={#1},subtree=disconnect},
  phantom/.default=,
  complemented phantom/.style={complemented/.style={phantom}},
  autofill parents male female*/.code={%
    \def\gtr@complementparents@levellimit{#1}%
    \let\gtr@parse@complementparents@hook\gtr@parse@complementparents@malefemale%
    \let\gtr@parent@@p\gtr@parent@@p@malefemale%
  },
  autofill parents male female*/.default=5,
  autofill parents male female/.style={%
    autofill parents male female*={#1},
    ignore level={\the\numexpr#1+1\relax},
  },
  autofill parents male female/.default=5,
  autofill parents female male*/.code={%
    \def\gtr@complementparents@levellimit{#1}%
    \let\gtr@parse@complementparents@hook\gtr@parse@complementparents@femalemale%
    \let\gtr@parent@@p\gtr@parent@@p@femalemale%
  },
  autofill parents female male/.style={%
    autofill parents female male*={#1},
    ignore level={\the\numexpr#1+1\relax},
  },
  autofill parents female male/.default=5,
  autofill parents unspecific*/.code={%
    \def\gtr@complementparents@levellimit{#1}%
    \let\gtr@parse@complementparents@hook\gtr@parse@complementparents@unspecific%
    \let\gtr@parent@@p\gtr@parent@@p@unspecific%
  },
  autofill parents unspecific*/.default=5,
  autofill parents unspecific/.code={%
    autofill parents unspecific*={#1},
    ignore level={\the\numexpr#1+1\relax},
  },
  autofill parents unspecific/.default=5,
  autofill parents none/.code={%
    \def\gtr@parse@complementparents@hook{}%
    \let\gtr@parent@@p\gtr@parent@@p@normal%
  },
}

\pgfkeys{/gtr/edge/.is family}
\def\gtredgeset{\pgfqkeys{/gtr/edge}}

\gtredgeset{
  edge@mode/.store in=\gtrkv@edgemode,
  perpendicular/.style={edge@mode=perpendicular},
  rounded@arc/.store in=\gtrkv@edge@arc,
  rounded/.style={edge@mode=rounded,rounded@arc={#1}},
  rounded/.default=6pt,
  swing@control/.store in=\gtrkv@edge@swingcontrol,
  swing/.style={edge@mode=swing,swing@control={#1}},
  swing/.default=12pt,
  mesh@options/.store in=\gtrkv@edge@meshoptions,
  mesh/.style={edge@mode=mesh,mesh@options={#1}},
  mesh/.default=,
  custom/.code n args={4}{%
    \let\gtr@edge@custom@down@macro=#1%
    \let\gtr@edge@custom@up@macro=#2%
    \let\gtr@edge@custom@left@macro=#3%
    \let\gtr@edge@custom@right@macro=#4%
    \gtredgeset{edge@mode=custom}%
  },
  none/.style={custom={\gtr@edge@custom@none@macro}{\gtr@edge@custom@none@macro}{\gtr@edge@custom@none@macro}{\gtr@edge@custom@none@macro}},
  foreground/.style={gtr@edge@foreground/.style={line width=1pt,draw=green!25!black,#1}},
  background/.style={gtr@edge@background/.style={line width=1.75pt,draw=green!15!white,#1}},
  no foreground/.style={gtr@edge@foreground/.style={draw=none,fill=none}},
  no background/.style={gtr@edge@background/.style={draw=none,fill=none}},
  anchoring/.is choice,
  anchoring/periphery/.code={%
    \def\gtrkv@edge@anchor@vert@A{north}%
    \def\gtrkv@edge@anchor@vert@B{south}%
    \def\gtrkv@edge@anchor@hori@A{east}%
    \def\gtrkv@edge@anchor@hori@B{west}%
    },
  anchoring/center/.code={%
    \def\gtrkv@edge@anchor@vert@A{center}%
    \def\gtrkv@edge@anchor@vert@B{center}%
    \def\gtrkv@edge@anchor@hori@A{center}%
    \def\gtrkv@edge@anchor@hori@B{center}%
  },
  hide single leg/.is choice,
  hide single leg/true/.code={\def\gtrkv@edge@noleg{1}},
  hide single leg/false/.code={\def\gtrkv@edge@noleg{0}},
  hide single leg/.default=true,
  xshift/.store in=\gtrkv@edge@core@xshift,
  yshift/.store in=\gtrkv@edge@core@yshift,
}

\def\gtr@adjust@position#1 #2 of #3 distance #4 shift #5 #6\@nil{%
  \gappto\gtrkv@after@parser{\gtr@adjust{#1}{#2}{#3}{#4}{#5}}%
}

\def\gtr@adjust@node@right#1#2#3#4{\gappto\gtrkv@after@parser{\gtr@adjust{#1}{right}{#2.east}{#3}{#4}}}
\def\gtr@adjust@node@left#1#2#3#4{\gappto\gtrkv@after@parser{\gtr@adjust{#1}{left}{#2.west}{#3}{#4}}}
\def\gtr@adjust@node@above#1#2#3#4{\gappto\gtrkv@after@parser{\gtr@adjust{#1}{above}{#2.north}{#3}{#4}}}
\def\gtr@adjust@node@below#1#2#3#4{\gappto\gtrkv@after@parser{\gtr@adjust{#1}{below}{#2.south}{#3}{#4}}}

\def\gtr@adjust@node#1 #2 of #3 distance #4 shift #5 #6\@nil{%
  \csname gtr@adjust@node@#2\endcsname{#1}{#3}{#4}{#5}%
}

\gtrset{
  adjust position/.code={\gtr@adjust@position#1 shift 0mm \@nil},%
  adjust node/.code={\gtr@adjust@node#1 shift 0mm \@nil},%
  set position/.code args={#1 at #2}{\gappto\gtrkv@after@parser{\gtr@setposition{#1}{#2}}},%
}

\gtrset{%
  turn/.is choice,
  turn/.default=right,
  turn/right/.style={box={rotate=90,gtrNodeDimensionsLandscape}},
  turn/left/.style={box={rotate=270,gtrNodeDimensionsLandscape}},
  turn/off/.style={box={rotate=0,gtrNodeDimensions}},
  turn/upsidedown/.style={box={rotate=180,gtrNodeDimensions}},
  %
  male/.style={box={male}},
  female/.style={box={female}},
  neuter/.style={box={neuter}},
}

\gtrset{%
  reset/.style={%
    reset edge level shift,
    id prefix=,
    id suffix=,
    timeflow=down,
    level distance=5mm,
    level size=3.5cm,
    node size=2.5cm,
    proband level=0,
    tree offset=0pt,
    level/.style=,
    complemented/.style=,
    box clear,
    processing=fit,
    edges={perpendicular,foreground=,background=,anchoring=periphery,hide single leg,xshift=0pt,yshift=0pt},
    child distance in parent graph=1mm,%
    child distance in child graph=2mm,%
    parent distance in parent graph=2mm,%
    parent distance in child graph=1mm,%
    further distance=3mm,%
    tikzpicture=,code={\def\gtrkv@tikzset{}\def\gtrkv@tcbset{}},%
    ignore family database,
    label options=,
    label database options=,
    no content interpreter,
    insert for childless families=,
    insert for childless families level limit=-2147483647,
    autofill parents none,
  },
  reset
}