summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/familytree/README.md
blob: 944c10aab82b69f4a71a994ca4f1eb42dd31917e (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

# familytree package
`jiro1010senju AT gmail DOT com`

---
```
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
any later version.

This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this package.  If not, see <http://www.gnu.org/licenses/>.
```
---

Some LaTeX macros (or commands) to draw a family tree.


# Install

`$ make Dir=/tmp`

You will get these files under `/tmp`.
```
familytree.sty
familytree.pdf
familytree-ja.pdf
Crawley.pdf
Asai.pdf
Tokugawa.pdf
```

`$ make InstallDir=/tmp/texmf-dist install`

You will get these under `/tmp/texmf-dist`.

```
tex/latex/familytree.sty
source/latex/familytree/familytree.pdf
source/latex/familytree/familytree-ja.pdf
source/latex/familytree/Crawley.pdf
source/latex/familytree/Asai.pdf
source/latex/familytree/Tokugawa.pdf
```


# Usage

1.
```
\indvdldef{Harry}{Harry}
\indvdldef{Lily}{Lily}[\matrilineal]
\pcdef{Potters}{Lily}{Harry}
\fbox{\usebox{\Potters}}
```

2.
```
\indvdldef{Petunia}{Petunia}
\indvdldef{Lily}{Lily}
\sblngdef{sis}{Petunia,Lily}
\fbox{\usebox{\sis}}
```

3.
```
\indvdldef{Lily}{Lily}
\indvdldef[\blank]{James}{James Potter}[\haschild]
\mrrgdef{Potters}{James}{Lily}{}
\fbox{\usebox{\Potters}}
```

4.
```
\indvdldef{Petunia}{Petunia}
\indvdldef[\blank]{Vernon}{Vernon Dursley}[\haschild]
\mrrgdef{Dursleys}{Vernon}{Petunia}{}
%\fbox{\usebox{\Dursleys}}

\newsavebox{\boxA}
\savebox{\boxA}{\hbox{Petunia}}
\indvdldef{Lily}{\hbox to \wd\boxA{Lily}}
\indvdldef[\blank]{James}{James Potter}[\haschild]
\mrrgdef{Potters}{}{Lily}{James}[\dimexpr\wd\Vernon - \wd\James\relax]
%\fbox{\usebox{\Potters}}

\sblngdef{sis}{Dursleys,ivali,Potters}
\fbox{\usebox{\sis}}
```


# Syntax

To define an individual,
```
\indvdldef
	[child mark]
	{new box name}
	[title]
	{individual name}
	[list of additional info or attributes]
	[maleline xlength]
```

- child mark
  + `\ftbiological`
  + `\ftadopted`
  + `\fttop`
  + `\ftblank`

- attribute
  + `\fthaschild`
  + `\ftprivate`
  + `\ftmaleline, \ftfemaleline, \ftpatrilineal, \ftmatrilineal`

---

To define the siblings,
```
\sblngdef
	{new box name}
	{name list of individual boxes}
```

You can insert the "interval box" in the name list, to make the
spaces between the siblings.

To define the interval box,
```
\ivaldef
	{box-name}
	{length}
```

There are three pre-defined interval boxes, `\ival`, `\ivali`, and `\ivalii`.

---

To define a parent-child relationship,
```
\pcdef
	{new box name}
	{parent box name}
	{child box name}
```

To define the generations,
```
\gensdef
	{new box name}
	{parent box name}
	{list of connection-pair}
```

```
connection-pair :=
	{individual box name in the parent box}
	{child box name}
```

---

To define a married couple or the spouses,
```
\mrrgdef
	{new box name}
	{spouse list A}
	{oneself}
	{spouse list B}
	[childline xlength]
```


Configuration
-------------

```
\nameboxcfg
	{space from the child mark}
	{font}
	{space to the maleline}
	{maleline length}

\cmarkboxcfg
	{space between two lines, for adopted}
	{line length}

\titleboxcfg
	{indent}
	{font}
	{linestretch}
	{vspace to the individual name}

\optboxcfg
	{vspace from the individual name}
	{indent}
	{font}
	{linestretch}

\sblngboxcfg
	{space-length}
```


For more details, refer to `*.dtx`, `familytree.pdf` or `familytree-ja.pdf`,
and `samples/` sub-dir.