Debian Codegraph @

texmf-dist/source/latex/familytree/ft-individual.dtx

raw
1 % \iffalse
2 % Copyright 2022 Jiro Senju
3 %
4 % This package is free software; you can redistribute it and/or modify
5 % it under the terms of the GNU General Public License as published by
6 % the Free Software Foundation; either version 2 of the License, or
7 % any later version.
8 %
9 % This package is distributed in the hope that it will be useful,
10 % but WITHOUT ANY WARRANTY; without even the implied warranty of
11 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 % GNU General Public License for more details.
13 %
14 % You should have received a copy of the GNU General Public License
15 % along with this package. If not, see <http://www.gnu.org/licenses/>.
16 % \fi
17 %
18 % \section{Individual Box (\texttt{ft-individual.dtx})}
19 %
20 % \DescribeMacro{\indvdldef}
21 % \indent
22 % \cmd{\indvdldef
23 % \oarg{child mark}
24 % \marg{new box name}
25 % \oarg{title}
26 % \marg{individual name}
27 % \oarg{additional info}
28 % \oarg{maleline xlength}
29 % }
30 % \medskip
31 %
32 % Defines a new box named \meta{new box name}, and layouts the
33 % given arguments in that box.
34 %
35 % \begin{enumerate}
36 % \item \oarg{child mark}
37 % \par
38 % The type of a line which is located ahead of the individual name.
39 % \par
40 % Specify one of |\ftbiological|,
41 % |\ftadopted|,
42 % |\fttop|,
43 % or |\ftblank|.
44 % Details are discussed later.
45 %
46 % \item \marg{new box name}
47 % \par
48 % The name of a new box.
49 % \par
50 % This is not a \CS{} (no backslash).
51 %
52 % \item \oarg{title}
53 % \par
54 % One's title.
55 % \par
56 % Put at the shoulder of the individual name with a smaller font
57 % (|\relsize{-2}|).
58 %
59 % \item \marg{individual name}
60 % \par
61 % One's name.
62 %
63 % \item \oarg{additional info}
64 % \par
65 % Additional information.
66 % \par
67 % Anything can be added such as birth\slash death year-month-date and alias.
68 % Put with a little smaller font (|\relsize{-1}|) at next to the individual name.
69 % Also the attributes (discussed later),
70 % |\ftmaleline| (|\ftfemaleline|, |\ftpatrilineal|, |\ftmatrilineal|),
71 % \allowbreak|\fthaschild|,
72 % |\ftprivate| are specified here.
73 %
74 % \item \oarg{maleline xlength}
75 % \par
76 % When you draw a line from an individual (instead of a marriage box) to
77 % a child, the length of the line can be adjusted by this argument.
78 % But in the sibling box, the line length will be adjusted automatically
79 % regardless this argument.
80 % \end{enumerate}
81 %
82 % Also |\indvdldef| defines some connection points as \CS. The origin is
83 % left-bottom of the box and the unit is |pt|.
84 %
85 % \begin{table}
86 % \hfil\begin{tabular}{ll}
87 % \meta{box name}|nameX| &
88 % the tail of the individual name
89 % \\
90 %
91 % \meta{box name}|nameCX| &
92 % the center of the width of individual name
93 % \\
94 %
95 % \meta{box name}|nameCY| &
96 % the center of the height of individual name
97 % \end{tabular}
98 % \end{table}
99 %
100 % For \oarg{child mark}, you can specify one of these values.
101 %
102 % \begin{itemize}
103 % \item |\biological| or |\ftbiological|
104 % \par
105 % a single line to represent a biological\slash real child.
106 %
107 % \item |\adopted| or |\ftadopted|
108 % \par
109 % a double line to represent an adopted child.
110 %
111 % \item |\fttop| (or |\top|)
112 % \par
113 % no line at all.
114 %
115 % \item |\blank| or |\ftblank|
116 % \par
117 % put a space whose size is equal to the |\biological| or |\adopted| mark,
118 % assuming used for the spouse in a marriage box.
119 % \end{itemize}
120 % \bigskip
121 %
122 % For \oarg{additional info}, you can specify any of these attributes.
123 %
124 % \begin{itemize}
125 % \item |\haschild| or |\fthaschild|
126 % \par
127 % represents a spouse who has a child.
128 % draws a line in a marriage box to their child from the center of the
129 % double line which represents a marriage.
130 %
131 % \item |\private| or |\ftprivate|
132 % \par
133 % represents the marriage is not official.
134 % draws a dashed double line.
135 %
136 % \item |\maleline| or |\ftmaleline|
137 % \par
138 % draws a line to a child from the individual name instead of the double
139 % line in the marriage box.
140 % |\ftfemaleline|,
141 % |\ftpatrilineal|,
142 % |\ftmatrilineal| are all equivalent.
143 % \end{itemize}
144 % \bigskip
145 %
146 % The individual box consists of a few smaller boxes.
147 %
148 % \begin{itemize}
149 % \item |\ft@titlebox|
150 % \item |\ft@namebox|
151 % \par
152 % In |\ft@namebox|, there are |\ft@cmarkbox| which represents the
153 % \meta{child mark}
154 % and |\ft@malelinebox| which represents \meta{maleline}.
155 %
156 % \item |\ft@optbox|
157 % \end{itemize}
158 %
159 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
160 % \subsection{Customization}
161 %
162 % \DescribeMacro{\nameboxcfg}
163 % \indent
164 % \cmd{\nameboxcfg
165 % \marg{space from the child mark}
166 % \marg{font}
167 % \marg{space to the maleline}
168 % \marg{maleline length}
169 % }
170 % \medskip
171 %
172 % \DescribeMacro{\cmarkboxcfg}
173 % \cmd{\cmarkboxcfg
174 % \marg{space between two lines, for adopted}
175 % \marg{line length}
176 % }
177 % \medskip
178 %
179 % \DescribeMacro{\titleboxcfg}
180 % \cmd{\titleboxcfg
181 % \marg{indent}
182 % \marg{font}
183 % \marg{linestretch}
184 % \marg{vspace to the individual name}
185 % }
186 % \medskip
187 %
188 % \DescribeMacro{\optboxcfg}
189 % \cmd{\optboxcfg
190 % \marg{vspace from the individual name}
191 % \marg{indent}
192 % \marg{font}
193 % \marg{linestretch}
194 % }
195 %
196 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
197 % \needspace{12ex}
198 % \subsection{Example}
199 %
200 % \begin{enumerate}
201 % \item
202 % \srcfig{fig1Robert1}
203 %
204 % \item
205 % \srcfig{fig1Robert2}
206 % \end{enumerate}
207 %
208 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
209 % \subsectImpl
210 %
211 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
212 % \subsubsection{Child-mark box}
213 %
214 % \parag{Customization}
215 %
216 % \DescribeMacro{\ftcmarkboxcfg}
217 % \DescribeMacro{\cmarkboxcfg}
218 %
219 % \begin{macrocode}
220 \newlength{\ft@cmarkbox@adopted@sep}
221 \setlength{\ft@cmarkbox@adopted@sep}{4pt}
222 \newlength{\ft@cmarkbox@length}
223 \setlength{\ft@cmarkbox@length}{1\ft@unit}
224 \newcommand{\ftcmarkboxcfg}[2]{% adopted-sep line-length
225 \ifx#1\empty\else%
226 \setlength{\ft@cmarkbox@adopted@sep}{#1}%
227 \fi%
228 \ifx#2\empty\else%
229 \setlength{\ft@cmarkbox@length}{#2}%
230 \fi%
231 }
232 \ft@alias{cmarkboxcfg}
233 % \end{macrocode}
234 %
235 % \parag{Define a box}
236 %
237 % \DescribeMacro{\fttop}
238 % \DescribeMacro{\top}
239 % \DescribeMacro{\ftbiological}
240 % \DescribeMacro{\biological}
241 % \DescribeMacro{\ftadopted}
242 % \DescribeMacro{\adopted}
243 % \DescribeMacro{\ftblank}
244 % \DescribeMacro{\blank}
245 %
246 % \begin{macrocode}
247 \chardef\fttop=0
248 \chardef\ftbiological=1
249 \chardef\ftadopted=2
250 \chardef\ftblank=3
251 \ft@alias{top}
252 \ft@alias{biological}
253 \ft@alias{adopted}
254 \ft@alias{blank}
255 % \end{macrocode}
256 %
257 % \DescribeMacro{\ft@indvdl@nameH}
258 % \DescribeMacro{\ft@indvdl@nameD}
259 % \DescribeMacro{\ft@indvdl@nameCY}
260 % \DescribeMacro{\ft@do@cmarkdef}
261 % \DescribeMacro{\ft@cmarkdef}
262 %
263 % \begin{macrocode}
264 \newsavebox{\ft@cmarkbox}
265 \newlength{\ft@cmarkW}
266 \newlength{\ft@indvdl@nameH}
267 \newlength{\ft@indvdl@nameD}
268 \newlength{\ft@indvdl@nameCY}
269 \newcommand{\ft@do@cmarkdef}[4]{% cmarkbox-name cmark width line-length
270 \ft@savenamebox{#1}{%
271 \edef\@w{\strip@pt#3}%
272 \edef\@h{\strip@pt\ft@indvdl@nameH}%
273 \edef\@l{\strip@pt#4}%
274 \begin{picture}(\@w,\@h)%
275 \ft@dbgframe{\@w,\@h}%
276 \ifcase#2% fttop
277 \or% ftbiological
278 \put(0,\strip@pt\ft@indvdl@nameCY){\line(1,0){\@l}}%
279 \or% ftadopted
280 \ft@y=\dimexpr\ft@indvdl@nameCY%
281 + .5\ft@cmarkbox@adopted@sep\relax%
282 \put(0,\strip@pt\ft@y){\line(1,0){\@l}}%
283 \advance\ft@y -\ft@cmarkbox@adopted@sep%
284 \put(0,\strip@pt\ft@y){\line(1,0){\@l}}%
285 \or% \ftblank
286 \fi%
287 \end{picture}%
288 }%
289 \ft@nameboxsz{#1}{\ft@indvdl@nameH}{\ft@indvdl@nameD}%
290 }
291 % \end{macrocode}
292 %
293 % \begin{macrocode}
294 \newcommand{\ft@cmarkdef}[4]{%
295 % cmarkbox-name cmark cmark-xlength cmark-space
296 \ft@savenamebox{#1}{}% empty
297 \ifcase#2% fttop
298 \else%
299 \ft@len=\dimexpr\ft@cmarkbox@length + #3\relax\relax%
300 \ifdim\ft@len>0pt%
301 \ft@do@cmarkdef{#1}{#2}{\dimexpr\ft@len + #4\relax}{\ft@len}%
302 \fi%
303 \fi%
304 \ft@dbgbox{\@nameuse{#1}}%
305 }
306 % \end{macrocode}
307 %
308 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
309 % \needspace{3\baselineskip}
310 % \subsubsection{Additional info box}
311 % \nopagebreak
312 %
313 % \parag{Customization}
314 %
315 % \DescribeMacro{\ftoptboxcfg}
316 % \DescribeMacro{\optboxcfg}
317 %
318 % \begin{macrocode}
319 \newlength{\ft@optbox@vsp}
320 \setlength{\ft@optbox@vsp}{.1\baselineskip}
321 \newlength{\ft@optbox@indent}
322 \setlength{\ft@optbox@indent}{1.1\ft@unit}
323 \newcommand{\ft@optbox@font}{\relsize{-1}}%{\footnotesize}
324 \newcommand{\ft@optbox@linestretch}{.75}
325 \newcommand{\ftoptboxcfg}[4]{% vsp indent font linestretch
326 \ifx#1\empty\else%
327 \setlength{\ft@optbox@vsp}{#1}%
328 \fi%
329 \ifx#2\empty\else%
330 \setlength{\ft@optbox@indent}{#2}%
331 \fi%
332 \ifx#3\empty\else%
333 \renewcommand{\ft@optbox@font}{#3}%
334 \fi%
335 \ifx#4\empty\else%
336 \renewcommand{\ft@optbox@linestretch}{#4}%
337 \fi%
338 }
339 \ft@alias{optboxcfg}
340 % \end{macrocode}
341 %
342 % \parag{Parsing}
343 %
344 % \DescribeMacro{\ftmaleline}
345 % \DescribeMacro{\maleline}
346 % \DescribeMacro{\fthaschild}
347 % \DescribeMacro{\haschild}
348 % \DescribeMacro{\ftprivate}
349 % \DescribeMacro{\private}
350 %
351 % \begin{macrocode}
352 \newcommand{\ftmaleline}{ft@attr0}
353 \let\ftfemaleline=\ftmaleline
354 \let\ftpatrilineal=\ftmaleline
355 \let\ftmatrilineal=\ftmaleline
356 \newcommand{\fthaschild}{ft@attr1}
357 \newcommand{\ftprivate}{ft@attr2}
358 \ft@alias{maleline}
359 \ft@alias{femaleline}
360 \ft@alias{patrilineal}
361 \ft@alias{matrilineal}
362 \ft@alias{haschild}
363 \ft@alias{private}
364 % \end{macrocode}
365 %
366 % \DescribeMacro{\ft@optlist}
367 %
368 % Extracts the attributes from \meta{option-list} (which is
369 % \meta{additional info} itself) and sets a global flag whose name is
370 % generated using \meta{box-name}.
371 % Other than the attributes are appended another list, \meta{list} which
372 % will be printed later.
373 %
374 % \begin{macrocode}
375 \newcommand{\ft@optlist}[3]{% list box-name option-list
376 \edef\@male{\ftmaleline}%
377 \edef\@hasch{\fthaschild}%
378 \edef\@priv{\ftprivate}%
379 \@for\@temptokena:=#3\do{%
380 \edef\@opt{\@temptokena}%
381 \ft@dbgmsg{\@opt}%
382 \ifx\@opt\@male%
383 \global\ft@malelinetrue%
384 \ft@namexdef{#2hasmaleline}{\ftmaleline}%
385 \else%
386 \ifx\@opt\@hasch%
387 \ft@namexdef{#2haschild}{\fthaschild}%
388 \else%
389 \ifx\@opt\@priv%
390 \ft@namexdef{#2private}{\ftprivate}%
391 \else%
392 \ft@list@append{#1}{\@opt}%
393 \fi%
394 \fi%
395 \fi%
396 }%
397 }
398 % \end{macrocode}
399 %
400 % \parag{Define a box}
401 %
402 % \DescribeMacro{\ft@opt}
403 %
404 % \begin{macrocode}
405 \newsavebox{\ft@optbox}
406 \newcommand{\ft@opt}[1]{% option-list
407 \savebox{\ft@optbox}{%
408 \hspace{\ft@cmarkW}%
409 \hspace{\ft@optbox@indent}%
410 \vbox{%
411 \def\baselinestretch{\ft@optbox@linestretch}%
412 \ft@optbox@font%
413 \vspace{\ft@optbox@vsp}%
414 \@for\@temptokena:=#1\do{%
415 \vss%
416 \hbox{\@temptokena}%
417 \setbox\@tempboxa=\hbox{\@temptokena}%
418 \global\ft@depth=\dp\@tempboxa%
419 }%
420 }%
421 }%
422 \ft@len=\dimexpr\ht\ft@optbox + \dp\ft@optbox - \ft@depth\relax%
423 \ft@boxsz{\ft@optbox}{\ft@len}{\ft@depth}%
424 \ft@dbgbox{\ft@optbox}%
425 }
426 % \end{macrocode}
427 %
428 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
429 % \subsubsection{Name box}
430 %
431 % \parag{Customization}
432 %
433 % \DescribeMacro{\ftnameboxcfg}
434 % \DescribeMacro{\nameboxcfg}
435 %
436 % \begin{macrocode}
437 \newlength{\ft@namebox@sp}
438 \setlength{\ft@namebox@sp}{.25\ft@unit}
439 \newcommand{\ft@namebox@font}{}% empty
440 \newlength{\ft@namebox@maleline@sp}
441 \setlength{\ft@namebox@maleline@sp}{.25\ft@unit}
442 \newlength{\ft@namebox@maleline@length}
443 \setlength{\ft@namebox@maleline@length}{1.5\ft@unit}
444 \newcommand{\ftnameboxcfg}[4]{% sp font maleline-sp maleline-length
445 \ifx#1\empty\else%
446 \setlength{\ft@namebox@sp}{#1}%
447 \fi%
448 \ifx#2\empty\else%
449 \renewcommand{\ft@namebox@font}{#2}%
450 \fi%
451 \ifx#3\empty\else%
452 \setlength{\ft@namebox@maleline@sp}{#3}%
453 \fi%
454 \ifx#4\empty\else%
455 \setlength{\ft@namebox@maleline@length}{#4}%
456 \fi%
457 }
458 \ft@alias{nameboxcfg}
459 % \end{macrocode}
460 %
461 % \parag{Define a box}
462 %
463 % \DescribeMacro{\ft@name}
464 %
465 % Internally layouts |\ft@cmarkbox|, \meta{individual-name}, and
466 % |\ft@malelinebox|.
467 % It was difficult to set the length of |maleline|, ie. where to begin the
468 % line. Which is better for the head of |maleline|, at the box end of the
469 % \meta{individual-name} or at the box end including all the
470 % \meta{title}, \meta{individual-name} and \meta{additional info}?
471 %
472 % The latter looks good, especially when the defined individual box is
473 % used alone. But it makes hard for other box definitions to calculate the
474 % extra line length to align equal.
475 % For such calculation, the former is better since it just has to calculate
476 % the difference of the length of names.
477 % Finally, I decided to start the line at the end of
478 % \meta{individual-name}, and the default length is
479 % |\ft@namebox@maleline@length|.
480 %
481 % In other words, it can happen when an individual box is used alone, the
482 % \meta{title} or the \meta{additional info} may be longer than |maleline|.
483 %
484 % \begin{macrocode}
485 \newif\ifft@maleline
486 \newsavebox{\ft@malelinebox}
487 \newsavebox{\ft@namebox}
488 \newcommand{\ft@name}[3]{% box-name individual-name maleline-xlength
489 \setbox\@tempboxa=\hbox{\ft@namebox@font#2}%
490 \ft@len=\dimexpr\wd\@tempboxa + \ft@cmarkW%
491 + \ft@namebox@maleline@sp\relax%
492 \ft@namexdefstrip{#1nameX}{\ft@len}%
493 %
494 \ft@len=\dimexpr\wd\@tempboxa/2 + \ft@cmarkW\relax%
495 \ft@namexdefstrip{#1nameCX}{\ft@len}%
496 %
497 \def\@nm{\ft@namebox@font#2}%
498 \ifft@maleline%
499 % why are two 'relax'es necessary?
500 \@tempskipb=\dimexpr\ft@namebox@maleline@length%
501 - \ft@cmarkbox@length + #3\relax\relax%
502 \ifdim\@tempskipb>0pt%
503 \ft@cmarkdef{ft@malelinebox}{\ftbiological}{\@tempskipb}{0pt}%
504 \def\@nm{%
505 {\ft@namebox@font#2}%
506 \hspace{\ft@namebox@maleline@sp}%
507 \usebox{\ft@malelinebox}%
508 }%
509 \fi%
510 \fi%
511 \ft@dbgmsg{H \the\ht\@tempboxa, D \the\dp\@tempboxa}%
512 \ft@dbgmsg{H \the\ht\ft@cmarkbox, D \the\dp\ft@cmarkbox}%
513 \savebox{\ft@namebox}{%
514 \usebox{\ft@cmarkbox}%
515 \@nm%
516 }%
517 \ft@boxsz{\ft@namebox}{\ht\@tempboxa}{\dp\@tempboxa}%
518 \ft@dbgbox{\ft@namebox}%
519 }
520 % \end{macrocode}
521 %
522 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
523 % \needspace{2\baselineskip}
524 % \subsubsection{Title box}
525 %
526 % \parag{Customization}
527 %
528 % \hyphenation{line-stretch}
529 % \DescribeMacro{\fttitleboxcfg}
530 % \DescribeMacro{\titleboxcfg}
531 %
532 % \begin{macrocode}
533 \newlength{\ft@titlebox@indent}
534 \setlength{\ft@titlebox@indent}{-.25\ft@unit}
535 \newcommand{\ft@titlebox@font}{\relsize{-2}}%{\scriptsize}
536 \newcommand{\ft@titlebox@linestretch}{.25}
537 \newlength{\ft@titlebox@vsp}
538 \setlength{\ft@titlebox@vsp}{.1\baselineskip}
539 \newcommand{\fttitleboxcfg}[4]{% indent font linestretch vsp
540 \ifx#1\empty\else%
541 \setlength{\ft@titlebox@indent}{#1}%
542 \fi%
543 \ifx#2\empty\else%
544 \renewcommand{\ft@titlebox@font}{#2}%
545 \fi%
546 \ifx#3\empty\else%
547 \renewcommand{\ft@titlebox@linestretch}{#3}%
548 \fi%
549 \ifx#4\empty\else%
550 \setlength{\ft@titlebox@vsp}{#4}%
551 \fi%
552 }
553 \ft@alias{titleboxcfg}
554 % \end{macrocode}
555 %
556 % \parag{Define a box}
557 %
558 % \DescribeMacro{\ft@title}
559 %
560 % \begin{macrocode}
561 \newsavebox{\ft@titlebox}
562 \newcommand{\ft@title}[1]{% title
563 \ft@len=\dimexpr\ft@cmarkW + \ft@titlebox@indent\relax%
564 \savebox{\ft@titlebox}{%
565 \vbox{%
566 \def\baselinestretch{\ft@titlebox@linestretch}%
567 \ft@titlebox@font%
568 %
569 \setbox\@tempboxa=\hbox{#1}%
570 \ft@dbgmsg{H \the\ht\@tempboxa, D \the\dp\@tempboxa}%
571 \global\ft@depth=\dp\@tempboxa%
572 \hbox{\hspace{\ft@len}#1}%
573 \vspace{\ft@titlebox@vsp}%
574 \global\advance\ft@depth \ft@titlebox@vsp%
575 }%
576 }%
577 \ft@dbgmsg{H \the\ht\ft@titlebox, D \the\dp\ft@titlebox}%
578 \ft@len=\dimexpr\ht\ft@titlebox + \dp\ft@titlebox - \ft@depth\relax%
579 \ft@boxsz{\ft@titlebox}{\ft@len}{\ft@depth}%
580 \ft@dbgbox{\ft@titlebox}%
581 }
582 % \end{macrocode}
583 %
584 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
585 % \subsubsection{Combine the boxes --- core}
586 %
587 % \parag{Generate the boxes}
588 %
589 % \DescribeMacro{\ft@indvdlbox@gen}
590 % \NoDescription
591 % \begin{macrocode}
592 \newcommand{\ft@indvdlbox@gen}[4]{%
593 % box-name title individual-name maleline-xlength
594 \ft@width=0pt%
595 \IfValueT{#2}{%
596 \ft@title{#2}%
597 \ft@width=\wd\ft@titlebox%
598 }%
599 \global\@tempswafalse%
600 \ifx\ft@indvdl@opts\empty\else%
601 \global\@tempswatrue%
602 \ft@opt{\ft@indvdl@opts}%
603 \ifdim\ft@width<\wd\ft@optbox%
604 \ft@width=\wd\ft@optbox%
605 \fi%
606 \fi%
607 \ft@name{#1}{#3}{#4}%
608 }
609 % \end{macrocode}
610 %
611 % \parag{Calculate the size of a name box}
612 %
613 % \DescribeMacro{\ft@indvdlbox@calc}
614 % \NoDescription
615 % \begin{macrocode}
616 \newcommand{\ft@indvdlbox@calc}[2]{% box-name title
617 \global\ft@width=0pt%
618 \global\ft@height=0pt%
619 \global\ft@depth=0pt%
620 \def\ft@dpri##1{\ft@dbgmsg{##1 W \the\ft@width, H \the\ft@height,%
621 D \the\ft@depth}}%
622 \ft@dpri{h0}%
623 \IfValueT{#2}{%
624 \global\ft@width=\wd\ft@titlebox%
625 \global\ft@height=\dimexpr\ht\ft@titlebox + \dp\ft@titlebox\relax%
626 \ft@dpri{h1}%
627 }%
628 %
629 \global\advance\ft@height \ht\ft@namebox%
630 %
631 % mark this point of the height, to invert it later
632 \ft@y=\dimexpr\ft@height - \ft@indvdl@nameCY\relax%
633 %
634 \ifdim\ft@width<\wd\ft@namebox%
635 \global\ft@width=\wd\ft@namebox%
636 \fi%
637 \if@tempswa%
638 \global\advance\ft@height \dp\ft@namebox%
639 \else%
640 \global\ft@depth=\dp\ft@namebox%
641 \fi%
642 \ft@dpri{h2}%
643 %
644 \if@tempswa%
645 \ifdim\ft@width<\wd\ft@optbox%
646 \global\ft@width=\wd\ft@optbox%
647 \fi%
648 \global\advance\ft@height \ht\ft@optbox%
649 \global\ft@depth=\dp\ft@optbox%
650 \ft@dpri{h3}%
651 \fi%
652 \ft@dpri{h4}%
653 %
654 % invert the y
655 \ft@len=\dimexpr\ft@height - \ft@y\relax%
656 \ft@namexdefstrip{#1nameCY}{\ft@len}%
657 }
658 % \end{macrocode}
659 %
660 % \parag{Layout them by \texttt{picture}}
661 %
662 % \DescribeMacro{\ft@indvdlbox@layout}
663 % \NoDescription
664 % \begin{macrocode}
665 \newcommand{\ft@indvdlbox@layout}[2]{% box-name title
666 \ft@newnamebox{#1}{%
667 \edef\@w{\strip@pt\ft@width}%
668 \edef\@h{\strip@pt\ft@height}%
669 \begin{picture}(\@w,\@h)%
670 \ft@dbgframe{\@w,\@h}%
671 \ft@dbgplot{0,\@nameuse{#1nameCY}}%
672 %
673 \IfValueT{#2}{%
674 \advance\ft@height -\dimexpr\ht\ft@titlebox%
675 + \dp\ft@titlebox\relax%
676 \put(0,\strip@pt\ft@height){\usebox{\ft@titlebox}}%
677 }%
678 \advance\ft@height -\ht\ft@namebox%
679 \put(0,\strip@pt\ft@height){\usebox{\ft@namebox}}%
680 \advance\ft@height -\dp\ft@namebox%
681 \if@tempswa%
682 \advance\ft@height -\ht\ft@optbox%
683 \put(0,\strip@pt\ft@height){\usebox{\ft@optbox}}%
684 \fi%
685 \end{picture}%
686 }%
687 % height should hold the original value
688 \ft@nameboxsz{#1}{\ft@height}{\ft@depth}%
689 }
690 % \end{macrocode}
691 %
692 % \parag{Main function to combine the boxes}
693 %
694 % \DescribeMacro{\ft@indvdlbox}
695 % \NoDescription
696 % \begin{macrocode}
697 \newcommand{\ft@indvdlbox}[4]{%
698 % box-name title individual-name maleline-xlength
699 \ft@indvdlbox@gen{#1}{#2}{#3}{#4}%
700 \ft@indvdlbox@calc{#1}{#2}%
701 \ft@indvdlbox@layout{#1}{#2}%
702 %
703 \ft@dbgbox[\ft@dbgplot{0,\@nameuse{#1nameCY}}%
704 \ft@dbgplot{\@nameuse{#1nameCX},\strip@pt\ft@height}%
705 \ft@dbgplot{\@nameuse{#1nameX},\strip@pt\ft@height}%
706 ]{\@nameuse{#1}}%
707 }
708 % \end{macrocode}
709 %
710 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
711 % \subsubsection{Individual box --- interface}
712 %
713 % \DescribeMacro{\ftindvdldef}
714 % \DescribeMacro{\indvdldef}
715 %
716 % \begin{macrocode}
717 % [child-mark] box-name [title] individual-name
718 % [option-list...] [maleline-xlength]
719 \NewDocumentCommand{\ftindvdldef}{O{\ftbiological}momoO{0pt}}{%
720 \setbox\@tempboxa=\hbox{\ft@namebox@font#4}%
721 \global\ft@indvdl@nameH=\ht\@tempboxa%
722 \global\ft@indvdl@nameD=\dp\@tempboxa%
723 \if@tate%
724 \global\ft@indvdl@nameCY%
725 =\dimexpr(\ft@indvdl@nameH - \ft@indvdl@nameD)/2\relax%
726 \else%
727 \@ifundefined{jlreqsetup}{%
728 % not jlreq
729 \global\ft@indvdl@nameCY=\dimexpr(\ft@indvdl@nameH%
730 - \ft@indvdl@nameD) / 2\relax\relax%
731 }{%
732 % jlreq
733 % magic number! depends on font?
734 \global\ft@indvdl@nameCY=\dimexpr\ft@indvdl@nameH/2 - .66pt\relax%
735 }%
736 \fi%
737 \ft@dbgmsg{H \the\ft@indvdl@nameH, D \the\ft@indvdl@nameD,%
738 CY \the\ft@indvdl@nameCY}%
739 %
740 \ft@cmarkdef{ft@cmarkbox}{#1}{0pt}{\ft@namebox@sp}%
741 \ifcase#1% fttop
742 \ft@namexdef{#2hascmark}{#1}%
743 \or% ftbiological
744 \ft@namexdef{#2hascmark}{#1}%
745 \or% ftadopted
746 \ft@namexdef{#2hascmark}{#1}%
747 \fi%
748 \global\ft@cmarkW=\wd\ft@cmarkbox%
749 %
750 \global\ft@malelinefalse%
751 \xdef\ft@indvdl@opts{}%
752 \IfValueT{#5}{%
753 \ft@optlist{\ft@indvdl@opts}{#2}{#5}%
754 \ft@dbgmsg{opt \ft@indvdl@opts}%
755 }%
756 %
757 \ft@indvdlbox{#2}{#3}{#4}{#6}%
758 }
759 \ft@alias{indvdldef}
760 % \end{macrocode}