summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/familytree
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-06-28 03:01:06 +0000
committerNorbert Preining <norbert@preining.info>2022-06-28 03:01:06 +0000
commit2ef43af0215fc52966c9bbd8d5df6db6d6af224b (patch)
treef4575d7d44d673aef7008af7e6f14037472d4587 /macros/latex/contrib/familytree
parent2f80535c778eacefb7c73b39d2cb4f877f3d3341 (diff)
CTAN sync 202206280301
Diffstat (limited to 'macros/latex/contrib/familytree')
-rw-r--r--macros/latex/contrib/familytree/DEPENDS.txt3
-rw-r--r--macros/latex/contrib/familytree/LICENSE339
-rw-r--r--macros/latex/contrib/familytree/Makefile51
-rw-r--r--macros/latex/contrib/familytree/README.md212
-rw-r--r--macros/latex/contrib/familytree/cmd.mk45
-rw-r--r--macros/latex/contrib/familytree/doc-ja/Makefile37
-rw-r--r--macros/latex/contrib/familytree/doc-ja/familytree-ja.tex287
-rw-r--r--macros/latex/contrib/familytree/doc-ja/figs/Makefile74
-rw-r--r--macros/latex/contrib/familytree/doc-ja/figs/fig-ja.tex23
-rw-r--r--macros/latex/contrib/familytree/doc-ja/figs/fig1Hidetada.tex5
-rw-r--r--macros/latex/contrib/familytree/doc-ja/figs/fig1Ieyasu.tex24
-rw-r--r--macros/latex/contrib/familytree/doc-ja/figs/fig1base.tex4
-rw-r--r--macros/latex/contrib/familytree/doc-ja/figs/fig2Hidetada.tex28
-rw-r--r--macros/latex/contrib/familytree/doc-ja/figs/fig2base-ja.tex9
-rw-r--r--macros/latex/contrib/familytree/doc-ja/figs/fig2cfg.tex6
-rw-r--r--macros/latex/contrib/familytree/doc-ja/figs/fig2ival-ja.tex5
-rw-r--r--macros/latex/contrib/familytree/doc-ja/figs/fig3Hidetada.tex29
-rw-r--r--macros/latex/contrib/familytree/doc-ja/figs/fig3Iemitsu.tex28
-rw-r--r--macros/latex/contrib/familytree/doc-ja/figs/fig3Ietsuna.tex16
-rw-r--r--macros/latex/contrib/familytree/doc-ja/figs/fig4Hidetada.tex31
-rw-r--r--macros/latex/contrib/familytree/doc-ja/figs/fig4Ogou.tex6
-rw-r--r--macros/latex/contrib/familytree/doc-ja/figs/figTY-ja.tex41
-rw-r--r--macros/latex/contrib/familytree/doc-ja/ft-gens-ja.tex305
-rw-r--r--macros/latex/contrib/familytree/doc-ja/ft-individual-ja.tex456
-rw-r--r--macros/latex/contrib/familytree/doc-ja/ft-lib-ja.tex86
-rw-r--r--macros/latex/contrib/familytree/doc-ja/ft-marriage-ja.tex219
-rw-r--r--macros/latex/contrib/familytree/doc-ja/ft-sibling-ja.tex181
-rw-r--r--macros/latex/contrib/familytree/familytree-ja.pdfbin0 -> 504083 bytes
-rw-r--r--macros/latex/contrib/familytree/familytree.dtx260
-rw-r--r--macros/latex/contrib/familytree/familytree.ins12
-rw-r--r--macros/latex/contrib/familytree/familytree.pdfbin0 -> 178069 bytes
-rw-r--r--macros/latex/contrib/familytree/figs/Makefile76
-rw-r--r--macros/latex/contrib/familytree/figs/fig.tex9
-rw-r--r--macros/latex/contrib/familytree/figs/fig1Robert1.tex19
-rw-r--r--macros/latex/contrib/familytree/figs/fig1Robert2.tex3
-rw-r--r--macros/latex/contrib/familytree/figs/fig2base.tex13
-rw-r--r--macros/latex/contrib/familytree/figs/fig2ival.tex5
-rw-r--r--macros/latex/contrib/familytree/figs/fig2sis.tex25
-rw-r--r--macros/latex/contrib/familytree/figs/fig3Lily1.tex16
-rw-r--r--macros/latex/contrib/familytree/figs/fig3Lily2.tex17
-rw-r--r--macros/latex/contrib/familytree/figs/fig3Lily3.tex20
-rw-r--r--macros/latex/contrib/familytree/figs/fig3Lily4.tex18
-rw-r--r--macros/latex/contrib/familytree/figs/fig3Robert1.tex12
-rw-r--r--macros/latex/contrib/familytree/figs/fig3Robert2.tex13
-rw-r--r--macros/latex/contrib/familytree/figs/fig3sis.tex11
-rw-r--r--macros/latex/contrib/familytree/figs/fig4HenryVIII.tex20
-rw-r--r--macros/latex/contrib/familytree/figs/fig4Lily1.tex10
-rw-r--r--macros/latex/contrib/familytree/figs/fig4Lily2.tex12
-rw-r--r--macros/latex/contrib/familytree/figs/fig4Lily3.tex12
-rw-r--r--macros/latex/contrib/familytree/figs/fig4Lily4.tex12
-rw-r--r--macros/latex/contrib/familytree/figs/fig4Robert.tex23
-rw-r--r--macros/latex/contrib/familytree/fonts.tex3
-rw-r--r--macros/latex/contrib/familytree/ft-gens.dtx365
-rw-r--r--macros/latex/contrib/familytree/ft-individual.dtx760
-rw-r--r--macros/latex/contrib/familytree/ft-lib.dtx247
-rw-r--r--macros/latex/contrib/familytree/ft-marriage.dtx374
-rw-r--r--macros/latex/contrib/familytree/ft-sibling.dtx333
-rw-r--r--macros/latex/contrib/familytree/samples/Asai.pdfbin0 -> 184895 bytes
-rw-r--r--macros/latex/contrib/familytree/samples/Asai/0Ichi.tex43
-rw-r--r--macros/latex/contrib/familytree/samples/Asai/0sis.tex77
-rw-r--r--macros/latex/contrib/familytree/samples/Asai/1Chacha.tex64
-rw-r--r--macros/latex/contrib/familytree/samples/Asai/2Hatsu.tex76
-rw-r--r--macros/latex/contrib/familytree/samples/Asai/3Gou.tex104
-rw-r--r--macros/latex/contrib/familytree/samples/Asai/Asai.tex53
-rw-r--r--macros/latex/contrib/familytree/samples/Asai/Makefile19
-rw-r--r--macros/latex/contrib/familytree/samples/Crawley.pdfbin0 -> 19860 bytes
-rw-r--r--macros/latex/contrib/familytree/samples/Crawley.tex258
-rw-r--r--macros/latex/contrib/familytree/samples/Makefile24
-rw-r--r--macros/latex/contrib/familytree/samples/Tokugawa.pdfbin0 -> 182522 bytes
-rw-r--r--macros/latex/contrib/familytree/samples/Tokugawa/Makefile20
-rw-r--r--macros/latex/contrib/familytree/samples/Tokugawa/Tokugawa.tex299
-rw-r--r--macros/latex/contrib/familytree/samples/Tokugawa/tg-10th.tex25
-rw-r--r--macros/latex/contrib/familytree/samples/Tokugawa/tg-11th.tex11
-rw-r--r--macros/latex/contrib/familytree/samples/Tokugawa/tg-12th.tex14
-rw-r--r--macros/latex/contrib/familytree/samples/Tokugawa/tg-13th.tex6
-rw-r--r--macros/latex/contrib/familytree/samples/Tokugawa/tg-14th.tex1
-rw-r--r--macros/latex/contrib/familytree/samples/Tokugawa/tg-15th.tex3
-rw-r--r--macros/latex/contrib/familytree/samples/Tokugawa/tg-1st.tex1
-rw-r--r--macros/latex/contrib/familytree/samples/Tokugawa/tg-2nd.tex10
-rw-r--r--macros/latex/contrib/familytree/samples/Tokugawa/tg-3rd.tex22
-rw-r--r--macros/latex/contrib/familytree/samples/Tokugawa/tg-4th.tex35
-rw-r--r--macros/latex/contrib/familytree/samples/Tokugawa/tg-5th.tex27
-rw-r--r--macros/latex/contrib/familytree/samples/Tokugawa/tg-6th.tex21
-rw-r--r--macros/latex/contrib/familytree/samples/Tokugawa/tg-7th.tex14
-rw-r--r--macros/latex/contrib/familytree/samples/Tokugawa/tg-8th.tex9
-rw-r--r--macros/latex/contrib/familytree/samples/Tokugawa/tg-9th.tex15
86 files changed, 6501 insertions, 0 deletions
diff --git a/macros/latex/contrib/familytree/DEPENDS.txt b/macros/latex/contrib/familytree/DEPENDS.txt
new file mode 100644
index 0000000000..51174fac2f
--- /dev/null
+++ b/macros/latex/contrib/familytree/DEPENDS.txt
@@ -0,0 +1,3 @@
+# RequirePackage, CTAN pkgs
+relsize
+xparse
diff --git a/macros/latex/contrib/familytree/LICENSE b/macros/latex/contrib/familytree/LICENSE
new file mode 100644
index 0000000000..d159169d10
--- /dev/null
+++ b/macros/latex/contrib/familytree/LICENSE
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program 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
+ (at your option) any later version.
+
+ This program 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 program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/macros/latex/contrib/familytree/Makefile b/macros/latex/contrib/familytree/Makefile
new file mode 100644
index 0000000000..bc30a5a3da
--- /dev/null
+++ b/macros/latex/contrib/familytree/Makefile
@@ -0,0 +1,51 @@
+
+Dir ?= /tmp
+export Dir
+InstallDir ?= ${Dir}/texmf-dist
+export InstallDir
+
+include cmd.mk
+Lo = '\def\Dir{'${Dir}'}'
+
+########################################
+
+Name = familytree
+export Name
+Tgt = $(addprefix ${Dir}/${Name}., sty pdf)
+Dtx = $(addsuffix .dtx, ${Name} $(addprefix ft-, \
+ lib individual sibling gens marriage))
+
+########################################
+
+all: ${Tgt}
+ ${MAKE} -C samples $@
+ ${MAKE} -C doc-ja $@
+
+clean:
+ ${RM} *~ ${Tgt}
+ ${MAKE} -C figs --no-print-directory $@
+ ${MAKE} -C samples --no-print-directory $@
+ ${MAKE} -C doc-ja --no-print-directory $@
+
+install: all
+ install -m 444 -pD ${Dir}/${Name}.sty \
+ ${InstallDir}/tex/latex/${Name}.sty
+ install -m 444 -pD ${Dir}/${Name}.pdf \
+ ${InstallDir}/source/latex/${Name}/${Name}.pdf
+ ${MAKE} -C samples --no-print-directory $@
+ ${MAKE} -C doc-ja --no-print-directory $@
+# install -m 444 -pD *.dtx *.tex sample/ \
+# ${InstallDir}/source/latex/${Name}/
+
+########################################
+
+sty: ${Dir}/${Name}.sty
+${Dir}/${Name}.sty: ${Name}.ins ${Dtx}
+ $(call Latex, $<)
+ ls -l $@
+
+${Dir}/${Name}.pdf: %.pdf: %.sty
+ ${MAKE} -C figs
+ $(call MakePdf,${Name},dtx)
+
+-include priv.mk
diff --git a/macros/latex/contrib/familytree/README.md b/macros/latex/contrib/familytree/README.md
new file mode 100644
index 0000000000..944c10aab8
--- /dev/null
+++ b/macros/latex/contrib/familytree/README.md
@@ -0,0 +1,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.
diff --git a/macros/latex/contrib/familytree/cmd.mk b/macros/latex/contrib/familytree/cmd.mk
new file mode 100644
index 0000000000..9c259d2dc5
--- /dev/null
+++ b/macros/latex/contrib/familytree/cmd.mk
@@ -0,0 +1,45 @@
+
+Lo =
+LATEX ?= latex
+define Latex # texsrc
+ tmp=/tmp/$${$$}; \
+ rc=0; \
+ { \
+ ${LATEX} \
+ -halt-on-error -interaction=nonstopmode \
+ -no-mktex tfm -file-line-error \
+ -output-directory ${Dir} \
+ ${Lo}'\input' ${1} > $${tmp} ||\
+ { rc=$${?}; tail -20 $${tmp}; }; \
+ ${RM} $${tmp}; \
+ test $${rc} -eq 0; \
+ }
+endef
+
+TEXINPUTS := ${Dir}:${TEXINPUTS}
+export TEXINPUTS
+DVIPDFMX ?= dvipdfmx -q -f erewhon.map -f newtx.map -f Chivo.map
+PDFCROP ?= pdfcrop --noverbose
+
+define MakePdf
+ $(call Latex, ${1}.${2})
+ $(call Latex, ${1}.${2})
+ cd ${Dir}; \
+ ${DVIPDFMX} -o ${1}.pdf ${1}.dvi
+ ls -l ${Dir}/${1}.pdf
+endef
+
+define MakeFigPdf # tgtname texname
+ $(call Latex, ${2}.tex) && \
+ cd ${Dir} && \
+ ${DVIPDFMX} ${2}.dvi && \
+ ${PDFCROP} ${2}.pdf $@ && \
+ mv ${2}.dvi ${1}.dvi
+endef
+
+define MakePrintTex # src
+ grep -v '^%[^%]' ${1} |\
+ tr '\n' '\r' |\
+ sed -e 's/^\r\r*//' -e 's/\r\r*$$/\r/' |\
+ tr '\r' '\n'
+endef
diff --git a/macros/latex/contrib/familytree/doc-ja/Makefile b/macros/latex/contrib/familytree/doc-ja/Makefile
new file mode 100644
index 0000000000..4cfc10f8c3
--- /dev/null
+++ b/macros/latex/contrib/familytree/doc-ja/Makefile
@@ -0,0 +1,37 @@
+
+Dir ?= /tmp
+export Dir
+InstallDir ?= ${Dir}/texmf-dist
+
+LATEX ?= platex -kanji=euc
+include ../cmd.mk
+Lo = '\def\Dir{'${Dir}'}'
+
+########################################
+
+Name = familytree
+Tgt = ${Dir}/${Name}-ja.pdf
+Tex = $(addsuffix -ja.tex, ${Name} ${Name} $(addprefix ft-, \
+ lib individual sibling gens marriage))
+
+########################################
+
+all: ${Tgt}
+
+clean:
+ ${RM} *~ ${Tgt}
+ ${MAKE} -C figs $@
+
+install:
+ install -m 444 -pD ${Dir}/${Name}-ja.pdf \
+ ${InstallDir}/source/latex/${Name}/${Name}-ja.pdf
+
+# it should be already generated by upper make
+# ${Dir}/${Name}.sty:
+
+${Dir}/${Name}-ja.pdf: ${Tex} ${Dir}/${Name}.sty \
+ ${figPdf} ${figPrint} ${figLilyPdf} ${figLilyPrint}
+ ${MAKE} -C figs all
+ $(call MakePdf,${Name}-ja,tex)
+
+-include priv.mk
diff --git a/macros/latex/contrib/familytree/doc-ja/familytree-ja.tex b/macros/latex/contrib/familytree/doc-ja/familytree-ja.tex
new file mode 100644
index 0000000000..12c31edc33
--- /dev/null
+++ b/macros/latex/contrib/familytree/doc-ja/familytree-ja.tex
@@ -0,0 +1,287 @@
+\iffalse
+Copyright 2022 Jiro Senju
+
+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/>.
+\fi
+
+%\RequirePackage{plautopatch}
+% \documentclass[
+% draft,
+% jlreq_notes,open_bracket_pos=nibu_tentsuki
+% ]{jlreq}
+% jlreq and nameref don't co-work
+% \makeatletter
+% \show\section
+% \show\jlreq@headingcs@section
+% \patchcmd{\section}
+% {\@afterindenttrue}{\@afterindenttrue\def\@currentlabelname{#1}}
+% {}{\errmessage{patching section}}
+% \makeatother
+\documentclass[
+ draft
+]{jsarticle}
+\advance\evensidemargin 2zw
+\advance\oddsidemargin 2zw
+\advance\textwidth -2zw
+
+\usepackage{doc}
+\makeatletter
+% borrowd from ltxdoc.
+\def\cmd#1{\cs{\expandafter\cmd@to@cs\string#1}}
+\def\cmd@to@cs#1#2{\char\number`#2\relax}
+\makeatother
+\DeclareRobustCommand\cs[1]{\texttt{\char`\\#1}}
+\providecommand\marg[1]{%
+ {\ttfamily\char`\{}\meta{#1}{\ttfamily\char`\}}}
+\providecommand\oarg[1]{%
+ {\ttfamily[}\meta{#1}{\ttfamily]}}
+
+\input{../fonts}
+
+\usepackage[dvipdfmx,final]{graphicx}
+\usepackage[final]{listings}
+\usepackage{jlisting}
+\lstset{basicstyle=\small\ttfamily\mcfamily,
+ language=TeX,
+ columns=[c]flexible,
+ tabsize=4,
+ %frame=tb,
+ keepspaces=true,
+ lineskip=-.1em,
+ belowskip=\smallskipamount}
+\usepackage{multicol}
+\usepackage{needspace}
+%
+% hyperref should come last
+\usepackage[dvipdfmx,final,pdfusetitle]{hyperref}
+\usepackage{pxjahyper}
+% CJKbookmarks=true
+% bookmarksdepth=section
+% pdffitwindow=true
+% pdfpagetransition=Dissolve
+% pdfstartview=FitB
+\hypersetup{
+ hyperfootnotes=false,
+ colorlinks=true,
+ linkcolor=blue,
+ % anchorcolor=black,
+ % citecolor=black,
+ % urlcolor=black,
+ bookmarks=true,
+ bookmarksnumbered=true,
+ setpagesize=false,
+ %pdftitle={},
+ %pdfauthor={},
+ pdfpagelayout=SinglePage,
+ pdfpagemode=UseOutlines,
+ pdfstartview=FitH
+}
+
+\usepackage{familytree}
+
+\makeatletter
+\def\meta@font@select{\slshape}
+\def\fps@table{htbp}
+\makeatother
+
+%\xspcode`\\=3% it doesn't help
+
+\renewcommand{\contentsname}{目次}
+\renewcommand{\tablename}{表}
+\newcommand{\parag}[1]{%
+ \allowbreak%
+ \paragraph{#1}\nopagebreak\hskip0pt\nopagebreak%
+ \medskip%
+}
+\newcounter{CS}[section]
+\newcommand{\CS}{%
+ \ifnum\theCS=0%
+ control sequence%
+ \stepcounter{CS}%
+ \else%
+ CS%
+ \fi%
+}
+\newcommand{\srcfig}[2][]{%
+ {%
+ \noautoxspacing%
+ %\inhibitxspcode`)=2% is not helpful
+ \lstinputlisting{\Dir/#2print}%
+ \nopagebreak[4]%
+ }%
+ \nopagebreak[4]%
+ \hfil\includegraphics[#1]{\Dir/#2.pdf}%
+}
+\newcommand{\jslash}{~\slash{} \allowbreak}
+\newcommand{\IhadtoSplit}{%
+ 長い処理を分割し連続実行しているだけの、決して綺麗ではない構造。%
+ global変数を多用しており、よろしくない。%
+ だが、処理が長いと読みにくいため分割した。%
+}
+\newcommand{\FamilyTree}{家系図}
+\newcommand{\Patrilineal}{父系}
+\newcommand{\Matrilineal}{母系}
+\newcommand{\MaleLine}{男系}
+\newcommand{\FemaleLine}{女系}
+\newcommand{\InheritanceDiagram}{相続関係説明図}
+\let\tableautorefname=\tablename%
+\renewcommand{\subsectionautorefname}{}
+\newcommand{\refnm}[1]{%
+ \autoref{#1}「\nameref{#1}」%
+}
+
+\begin{document}
+\MakeShortVerb{\|}
+\GetFileInfo{familytree.sty}
+\title{{\spaceskip=1ex\textsf{familytree} package \fileversion}}
+\author{千住治郎\\\texttt{\small jiro1010senju AT gmail DOT com}}
+\date{\filedate}
+\maketitle
+
+\FamilyTree
+
+各人をboxとして定義し、各々を関係線でつなぐ。
+人物に情報を付加すれば\InheritanceDiagram としても使えるだろう。
+
+\begin{itemize}
+\item 父系\jslash 母系に対応
+\item 縦書きに対応(|jlreq.cls|のみ確認)
+\end{itemize}
+\bigskip
+
+(本文書は英語版|dtx|から説明部分を抜き出したものである)
+\bigskip
+
+\setcounter{tocdepth}{4}
+\columnseprule=\arrayrulewidth
+\begin{multicols}{2}
+\tableofcontents
+\end{multicols}
+\bigskip
+
+\setcounter{secnumdepth}{0}
+\section{はじめに}
+
+\FamilyTree はたまに眺めると興味深い。
+歴史からの影響もあると思うが、西洋では自分から始め両親のみを辿り、これを
+繰り返す形式が多いそうだ。2のべき乗で人物が増えて行くので見た
+目のバランスは採れている。
+国内では始祖から始める\Patrilineal 図
+(\MaleLine 図)
+が多いように思う。\Patrilineal のみを辿れば、図は比較的単純になるが、
+興味深さは半減する。
+兄弟姉妹関係のみならず婚姻関係も含めると、興味を大いにそそられる図にな
+るが、複雑さは飛躍的に増大する。
+
+Graphviz (|dot(1)|)を使っても図は描けるが、見やすくするのは難しい。
+また、|dot(1)|は国内で用いられる直線的な家系図には不向きではないかと思う。
+複雑な\FamilyTree でも間単に描けないかと試作したのが本パッケージである。
+著者のLatexの経験はそれほど多くないが、
+本パッケージが家系図を俯瞰する場合の一助になれば幸いである。
+コメントや改善提案等も大歓迎である。
+
+\subsection{実装について}
+
+基本的に全ての\CS 名にはprefix |ft|を付加している。
+しかし、利便性や視認性が犠牲になるため、
+prefixを除いたalias/synonymも|\let|で定義する。
+当然ながらalias名が未使用な場合に限る。
+
+\CS 名が既定義でaliasを定義できなかった場合は、
+その旨|\message|する。
+本文書でもprefixを省いたalias名を優先的に使用はするが、
+一部の\CS 名はprefix付きの名前を使用する。
+\smallskip
+
+|dtx|は複数に分割してあるが、
+生成される|sty|は一つである。
+本文書では|ft-lib.dtx|を最後に載せるが|sty|内では冒頭に位置する。
+
+|dtx|には行番号を付加する機能があるが、あえて潰してある。
+複数ある|dtx|の順序を変更してあるためだ。
+それぞれの|dtx|の冒頭でカウンタに値を入れ直してやれば、それらしい行
+番号は出力できるが、正確な値を拾い出すのは無理があるため止めた。
+|ins|から|sty|を生成した際の|log|に行数が残されるが、あてにならない
+数字だった。
+\smallskip
+
+|xparse|を使用しているためoption引数は先頭に限らない。引数を囲む括弧は
+適宜使い分ける必要がある。
+\bigskip
+
+当初は全て|\hbox|、|\vbox|、もしくは|tabular|で処理できると思っていた
+が、その後の線をつなげる段階で困った。
+glue等により
+|platex|が位置を調整してくれるので接続点が移動してしまい、
+汎用的\jslash 普遍的に線をつなげられないのだ。
+TikZ等では座標定義や座標間線分描画みたいなこともできるのだろうか。
+分からない。
+線をつなげるためには|picture|を選択せざ
+るを得なかった。線を描くためと言うよりも、描いた線をつなげるための
+layout目的だ。
+
+depthの扱いにも困った、と言うか私には知識、経験が足りなかった。
+本パッケージではboxを複数作成し、|picture|により配置するが、ここで
+depthを意識する必要があった。
+
+縦書き対応でもdepthは重要だった。横書きではfontが持つ、英字と同様の
+depthだが、縦書きでは和字の幅半分がdepthになる。
+この辺は単に私が知らなかったと言えばそれまでなのだが、
+ずいぶん手間がかかった。
+
+\subsection{構造}
+
+図を構成する要素毎にboxとして定義し、
+それらを連結する。
+人物間を線でつなぐ場合に備え、
+box定義時に接続点の座標を別途定義しておく。
+
+図の構成要素には次のものがある。
+
+\begin{enumerate}
+\needspace{2\baselineskip}
+\item 人物box
+ \begin{itemize}
+ \item 実子、養子等を表すchild mark
+ \item 肩書き
+ \item 人物名
+ \item \Patrilineal 図\jslash\Matrilineal 図に用いるmaleline\slash femaleline
+ \item 付加情報\par
+ 生没年、別名など
+ \end{itemize}
+
+\item 兄弟姉妹box
+ \begin{itemize}
+ \item それぞれのchild markをつなぐ実線
+ \item 人物名の間に間隔を設けるためのinterval box
+ \end{itemize}
+
+\item 婚姻box
+ \begin{itemize}
+ \item 二者をつなぐmarriage line(二重線)
+ \end{itemize}
+
+\item 親子または二世代box
+\end{enumerate}
+\bigskip
+
+以下、要素毎に説明する。
+
+\setcounter{secnumdepth}{4}
+\include{ft-individual-ja}
+\include{ft-sibling-ja}
+\include{ft-gens-ja}
+\include{ft-marriage-ja}
+\include{ft-lib-ja}
+\end{document}
diff --git a/macros/latex/contrib/familytree/doc-ja/figs/Makefile b/macros/latex/contrib/familytree/doc-ja/figs/Makefile
new file mode 100644
index 0000000000..a145c5ccd1
--- /dev/null
+++ b/macros/latex/contrib/familytree/doc-ja/figs/Makefile
@@ -0,0 +1,74 @@
+
+Dir ?= /tmp
+export Dir
+
+LATEX ?= platex -kanji=euc
+include ../../cmd.mk
+Lo = '\def\Dir{'${Dir}'}'
+
+Fig = fig1base fig1Ieyasu fig1Hidetada
+Fig += fig2base-ja fig2Hidetada fig2ival-ja fig2cfg
+Fig += fig3Hidetada fig3Ietsuna fig3Iemitsu
+Fig += fig4Hidetada fig4Ogou
+figLily = $(addprefix fig3Lily, 1 2 3 4) $(addprefix fig4Lily, 1 2 3 4)
+
+figTY = $(addsuffix T, ${Fig}) $(addsuffix Y, ${Fig})
+figTYPdf = $(addprefix ${Dir}/, $(addsuffix .pdf, ${figTY}))
+figPdf = $(addprefix ${Dir}/, $(addsuffix .pdf, ${Fig}))
+figPrint = $(addprefix ${Dir}/, $(addsuffix print.tex, ${Fig}))
+
+figLilyPdf = $(addprefix ${Dir}/, $(addsuffix .pdf, ${figLily}))
+figLilyPrint = $(addprefix ${Dir}/, $(addsuffix print.tex, ${figLily}))
+
+Tgt = ${figPdf} ${figPrint}
+
+########################################
+
+all: ${Tgt}
+
+clean:
+ ${RM} *~ ${Tgt}
+
+install:
+# do nothing
+
+########################################
+
+fig: ${figPdf}
+${figTYPdf}: Lo += '\def\figsrc{$(basename $<)}'
+${Dir}/%T.pdf: Lo += '\newif\ifmaketate\maketatetrue'
+${Dir}/%Y.pdf: Lo += '\newif\ifmaketate\maketatefalse'
+${Dir}/%T.pdf: %.tex figTY-ja.tex ${Dir}/${Name}.sty
+ $(call MakeFigPdf,$(basename $@),figTY-ja)
+ ebb $@
+${Dir}/%Y.pdf: %.tex figTY-ja.tex ${Dir}/${Name}.sty
+ $(call MakeFigPdf,$(basename $@),figTY-ja)
+ ebb $@
+
+${figPdf}: Lo = '\def\figsrc{$(notdir $(basename $@))}'
+${figPdf}: ${Dir}/%.pdf: fig-ja.tex ${Dir}/%T.pdf ${Dir}/%Y.pdf
+ $(call MakeFigPdf,$(basename $@),fig-ja)
+
+########################################
+
+untilComment = $(addprefix ${Dir}/, $(addsuffix print.tex, \
+ fig1Ieyasu fig2Hidetada fig3Hidetada fig4Hidetada))
+${untilComment}: ${Dir}/%print.tex: %.tex
+ sed -e '/^%$$/,$$d' $< | grep -v '^%' > $@
+
+noIndvdl = $(addprefix ${Dir}/, $(addsuffix print.tex, \
+ fig2ival-ja fig2cfg))
+${noIndvdl}: ${Dir}/%print.tex: %.tex
+ fgrep -vw indvdldef $< |\
+ fgrep -vx '' |\
+ $(call MakePrintTex, -) > $@
+
+# they should be already generated by upper make
+# ${figLilyPdf} ${figLilyPrint}:
+
+${Dir}/%Tprint.tex ${Dir}/%Yprint.tex: ${Dir}/%print.tex
+ cp -p $< $@
+${Dir}/%print.tex: %.tex
+ $(call MakePrintTex, $<) > $@
+
+-include priv.mk
diff --git a/macros/latex/contrib/familytree/doc-ja/figs/fig-ja.tex b/macros/latex/contrib/familytree/doc-ja/figs/fig-ja.tex
new file mode 100644
index 0000000000..8d01c647b1
--- /dev/null
+++ b/macros/latex/contrib/familytree/doc-ja/figs/fig-ja.tex
@@ -0,0 +1,23 @@
+\documentclass[
+ %tate,
+ %landscape,
+ 12pt,
+ jlreq_notes,open_bracket_pos=nibu_tentsuki
+]{jlreq}
+\usepackage[dvipdfmx,final]{graphicx}
+%\renewcommand{\baselinestretch}{.5}
+\begin{document}
+\pagestyle{empty}
+\hfill
+%\begin{figure}
+\includegraphics{\figsrc T.pdf}
+%\caption{縦書き}
+%\end{figure}
+\hfill
+%\begin{figure}
+\includegraphics{\figsrc Y.pdf}
+%\caption{横書き}
+%\end{figure}
+\hfill
+\hskip0pt
+\end{document}
diff --git a/macros/latex/contrib/familytree/doc-ja/figs/fig1Hidetada.tex b/macros/latex/contrib/familytree/doc-ja/figs/fig1Hidetada.tex
new file mode 100644
index 0000000000..e43769f8c8
--- /dev/null
+++ b/macros/latex/contrib/familytree/doc-ja/figs/fig1Hidetada.tex
@@ -0,0 +1,5 @@
+\indvdldef{秀忠}[二代]{秀忠}[\maleline]
+\fbox{\usebox{\秀忠}}
+
+\indvdldef[\adopted]{綱吉}[五代]{綱吉}[生類憐みの令,\maleline][3zw]
+\fbox{\usebox{\綱吉}}
diff --git a/macros/latex/contrib/familytree/doc-ja/figs/fig1Ieyasu.tex b/macros/latex/contrib/familytree/doc-ja/figs/fig1Ieyasu.tex
new file mode 100644
index 0000000000..755a217864
--- /dev/null
+++ b/macros/latex/contrib/familytree/doc-ja/figs/fig1Ieyasu.tex
@@ -0,0 +1,24 @@
+\indvdldef[\fttop]{家康}[初代]{家康}
+\fbox{\usebox{\家康}}
+%
+\newcommand{\boxsz}[1]{%
+ \texttt{\textbackslash#1} & \nameuse{#1}\\%
+}
+\newcommand{\tblA}{%
+ {%
+ \footnotesize%
+ \noautoxspacing%
+ \begin{tabular}{l|l}%
+ \boxsz{家康nameX}%
+ \boxsz{家康nameCX}%
+ \boxsz{家康nameCY}%
+ \end{tabular}%
+ }%
+}
+\ifmaketate
+ \tatechuyoko{\tblA}
+\else
+ \par
+ \bigskip
+ \tblA
+\fi
diff --git a/macros/latex/contrib/familytree/doc-ja/figs/fig1base.tex b/macros/latex/contrib/familytree/doc-ja/figs/fig1base.tex
new file mode 100644
index 0000000000..d5ca0c6299
--- /dev/null
+++ b/macros/latex/contrib/familytree/doc-ja/figs/fig1base.tex
@@ -0,0 +1,4 @@
+\titleboxcfg{}{}{}{.1ex}
+\optboxcfg{1ex}{}{}{1}
+\indvdldef{A}[肩書き]{人物名}[追加情報1,追加情報2]
+\fbox{\usebox{\A}}
diff --git a/macros/latex/contrib/familytree/doc-ja/figs/fig2Hidetada.tex b/macros/latex/contrib/familytree/doc-ja/figs/fig2Hidetada.tex
new file mode 100644
index 0000000000..4c6f428195
--- /dev/null
+++ b/macros/latex/contrib/familytree/doc-ja/figs/fig2Hidetada.tex
@@ -0,0 +1,28 @@
+\indvdldef{家光}[三代]{家光}
+\indvdldef{忠長}{忠長(駿河)}
+\indvdldef{正之}{正之(保科)}
+\sblngdef{秀忠の子}{家光,忠長,正之}
+\fbox{\usebox{\秀忠の子}}
+%
+\newcommand{\boxsz}[1]{%
+ \texttt{\textbackslash#1} & \nameuse{#1}\\%
+}
+\newcommand{\tblA}{%
+ {%
+ \footnotesize%
+ \noautoxspacing%
+ \begin{tabular}{l|l}%
+ \boxsz{秀忠の子nameCY}%
+ \boxsz{秀忠の子家光nameCY}%
+ \boxsz{秀忠の子忠長nameCY}%
+ \boxsz{秀忠の子正之nameCY}%
+ \end{tabular}%
+ }%
+}
+\ifmaketate
+ \tatechuyoko{\tblA}
+\else
+ \par
+ \bigskip
+ \tblA
+\fi
diff --git a/macros/latex/contrib/familytree/doc-ja/figs/fig2base-ja.tex b/macros/latex/contrib/familytree/doc-ja/figs/fig2base-ja.tex
new file mode 100644
index 0000000000..9a37de71c0
--- /dev/null
+++ b/macros/latex/contrib/familytree/doc-ja/figs/fig2base-ja.tex
@@ -0,0 +1,9 @@
+\indvdldef{A}{人物名}[\maleline]
+\fbox{\usebox{\A}}
+
+\indvdldef{B}{長い人物名}[\maleline]
+\fbox{\usebox{\B}}
+\bigskip
+
+\sblngdef{AB兄弟}{A,B}
+\fbox{\usebox{\AB兄弟}}
diff --git a/macros/latex/contrib/familytree/doc-ja/figs/fig2cfg.tex b/macros/latex/contrib/familytree/doc-ja/figs/fig2cfg.tex
new file mode 100644
index 0000000000..a862ea7836
--- /dev/null
+++ b/macros/latex/contrib/familytree/doc-ja/figs/fig2cfg.tex
@@ -0,0 +1,6 @@
+\indvdldef{家光}[三代]{家光}
+\indvdldef{忠長}{忠長(駿河)}
+\indvdldef{正之}{正之(保科)}
+\sblngboxcfg{4zh}
+\sblngdef{家光の兄弟}{家光,忠長,正之}
+\fbox{\usebox{\家光の兄弟}}
diff --git a/macros/latex/contrib/familytree/doc-ja/figs/fig2ival-ja.tex b/macros/latex/contrib/familytree/doc-ja/figs/fig2ival-ja.tex
new file mode 100644
index 0000000000..199c14957a
--- /dev/null
+++ b/macros/latex/contrib/familytree/doc-ja/figs/fig2ival-ja.tex
@@ -0,0 +1,5 @@
+\indvdldef{家光}[三代]{家光}
+\indvdldef{忠長}{忠長(駿河)}
+\indvdldef{正之}{正之(保科)}
+\sblngdef{家光の兄弟}{家光,ivalii,忠長,ival,正之}
+\fbox{\usebox{\家光の兄弟}}
diff --git a/macros/latex/contrib/familytree/doc-ja/figs/fig3Hidetada.tex b/macros/latex/contrib/familytree/doc-ja/figs/fig3Hidetada.tex
new file mode 100644
index 0000000000..fd35b56497
--- /dev/null
+++ b/macros/latex/contrib/familytree/doc-ja/figs/fig3Hidetada.tex
@@ -0,0 +1,29 @@
+\indvdldef{家光}[三代]{家光}[\maleline]
+\indvdldef{忠長}{忠長(駿河)}
+\indvdldef{正之}{正之(保科)}
+\sblngdef{秀忠の子}{家光,忠長,正之}
+
+\indvdldef{秀忠}[二代]{秀忠}[\maleline]
+\pcdef{秀忠親子}{秀忠}{秀忠の子}
+\fbox{\usebox{\秀忠親子}}
+%
+\newcommand{\boxsz}[1]{%
+ \texttt{\textbackslash#1} & \nameuse{#1}\\%
+}
+\newcommand{\tblA}{%
+ {%
+ \footnotesize%
+ \noautoxspacing%
+ \begin{tabular}{l|l}%
+ \boxsz{秀忠親子nameCY}%
+ \boxsz{秀忠親子秀忠の子Y}%
+ \end{tabular}%
+ }%
+}
+\ifmaketate
+ \raisebox{6.5zh}{\tatechuyoko{\tblA}}
+\else
+ \par
+ \bigskip
+ \tblA
+\fi
diff --git a/macros/latex/contrib/familytree/doc-ja/figs/fig3Iemitsu.tex b/macros/latex/contrib/familytree/doc-ja/figs/fig3Iemitsu.tex
new file mode 100644
index 0000000000..17d3bf5e4c
--- /dev/null
+++ b/macros/latex/contrib/familytree/doc-ja/figs/fig3Iemitsu.tex
@@ -0,0 +1,28 @@
+\indvdldef[\adopted]{綱吉}[五代]{綱吉}
+
+\indvdldef{綱豊}{綱豊(後の六代 家宣)}
+\indvdldef{清武}{清武(松平)}
+\sblngdef{綱重の子}{綱豊,清武}
+
+\indvdldef{家綱}[四代]{家綱}[\maleline]
+\indvdldef{綱重}{綱重(甲府)}[\maleline]
+\indvdldef{徳松}{徳松(後の五代 綱吉)}
+\sblngdef{家光の子}{家綱,ival,綱重,徳松}
+
+\gensdef{家綱綱吉}{家光の子}{%
+ {家綱}{綱吉},%
+ {綱重}{綱重の子}%
+}
+
+\indvdldef{家光}[三代]{家光}[\maleline]
+\indvdldef{忠長}{忠長(駿河)}
+\indvdldef{正之}{正之(保科)}
+\sblngdef{秀忠の子}{家光,忠長,正之}
+
+\gensdef{家光家綱}{秀忠の子}{%
+ {家光}{家綱綱吉}%
+}
+
+\indvdldef{秀忠}[二代]{秀忠}[\maleline]
+\pcdef{秀忠家光}{秀忠}{家光家綱}
+\fbox{\usebox{\秀忠家光}}
diff --git a/macros/latex/contrib/familytree/doc-ja/figs/fig3Ietsuna.tex b/macros/latex/contrib/familytree/doc-ja/figs/fig3Ietsuna.tex
new file mode 100644
index 0000000000..504a92a740
--- /dev/null
+++ b/macros/latex/contrib/familytree/doc-ja/figs/fig3Ietsuna.tex
@@ -0,0 +1,16 @@
+\indvdldef[\adopted]{綱吉}[五代]{綱吉}
+
+\indvdldef{綱豊}{綱豊(後の六代 家宣)}
+\indvdldef{清武}{清武(松平)}
+\sblngdef{綱重の子}{綱豊,清武}
+
+\indvdldef{家綱}[四代]{家綱}[\maleline]
+\indvdldef{綱重}{綱重(甲府)}[\maleline]
+\indvdldef{徳松}{徳松(後の五代 綱吉)}
+\sblngdef{家光の子}{家綱,ival,綱重,徳松}
+
+\gensdef{家綱綱吉}{家光の子}{%
+ {家綱}{綱吉},%
+ {綱重}{綱重の子}%
+}
+\fbox{\usebox{\家綱綱吉}}
diff --git a/macros/latex/contrib/familytree/doc-ja/figs/fig4Hidetada.tex b/macros/latex/contrib/familytree/doc-ja/figs/fig4Hidetada.tex
new file mode 100644
index 0000000000..c7523c97b2
--- /dev/null
+++ b/macros/latex/contrib/familytree/doc-ja/figs/fig4Hidetada.tex
@@ -0,0 +1,31 @@
+\indvdldef{秀忠}[二代]{秀忠}
+\indvdldef[\blank]{小姫}{小姫(羽柴)}[おひめ 最初の縁組 死別]
+\indvdldef[\blank]{江}{江(浅井)}[小督 於江与,おごう おえよ,\haschild]
+\indvdldef[\blank]{於静}{於静(神尾)}[しずか おしず 没後側室,\private,%
+ \haschild]
+\mrrgdef{秀忠夫婦}{}{秀忠}{小姫,江,於静}
+\fbox{\usebox{\秀忠夫婦}}
+%
+\newcommand{\boxsz}[1]{%
+ \texttt{\textbackslash#1} & \nameuse{#1}\\%
+}
+\newcommand{\tblA}{%
+ {%
+ \footnotesize%
+ \noautoxspacing%
+ \begin{tabular}{l|l}%
+ \boxsz{秀忠夫婦nameCY}%
+ \boxsz{秀忠夫婦秀忠nameCY}%
+ \boxsz{秀忠夫婦小姫mrrgCY}%
+ \boxsz{秀忠夫婦江mrrgCY}%
+ \boxsz{秀忠夫婦於静mrrgCY}%
+ \end{tabular}%
+ }%
+}
+\ifmaketate
+ \raisebox{6.5zh}{\tatechuyoko{\tblA}}
+\else
+ \par
+ \bigskip
+ \tblA
+\fi
diff --git a/macros/latex/contrib/familytree/doc-ja/figs/fig4Ogou.tex b/macros/latex/contrib/familytree/doc-ja/figs/fig4Ogou.tex
new file mode 100644
index 0000000000..a1e0967606
--- /dev/null
+++ b/macros/latex/contrib/familytree/doc-ja/figs/fig4Ogou.tex
@@ -0,0 +1,6 @@
+\indvdldef{江}{江(ごう)}
+\indvdldef[\blank]{一成}{佐治一成}[最初の夫]
+\indvdldef[\blank]{秀勝}{豊臣秀勝}[二番目,\haschild]
+\indvdldef[\blank]{秀忠}{徳川秀忠}[三番目,\haschild]
+\mrrgdef{江夫婦}{一成,秀勝,ivalii,秀忠}{江}{}
+\fbox{\usebox{\江夫婦}}
diff --git a/macros/latex/contrib/familytree/doc-ja/figs/figTY-ja.tex b/macros/latex/contrib/familytree/doc-ja/figs/figTY-ja.tex
new file mode 100644
index 0000000000..72863117b8
--- /dev/null
+++ b/macros/latex/contrib/familytree/doc-ja/figs/figTY-ja.tex
@@ -0,0 +1,41 @@
+\ifmaketate
+\documentclass[
+ tate,
+ %landscape,
+ 12pt,
+ jlreq_notes,open_bracket_pos=nibu_tentsuki
+]{jlreq}
+\else
+\documentclass[
+ %tate,
+ %landscape,
+ 12pt,
+ jlreq_notes,open_bracket_pos=nibu_tentsuki
+]{jlreq}
+\fi
+
+\input{../../fonts}
+%\usepackage{plext}
+\usepackage{familytree}
+\makeatletter
+\let\nameuse=\@nameuse
+\let\stript=\strip@pt
+\makeatother
+\newlength{\len}
+\newsavebox{\abox}
+\newcommand{\nbox}[2][]{%
+ \savebox{\abox}{#2}%
+ \len=\ht\abox%
+ \advance\len \dp\abox%
+ \begin{picture}(\stript\wd\abox,\stript\ht\abox)%
+ \put(0,-\stript\dp\abox){\framebox(\stript\wd\abox,\stript\len){}}%
+ \put(0,0){\usebox{\abox}}%
+ #1%
+ \end{picture}%
+ H \the\ht\abox, D \the\dp\abox%
+}
+%\renewcommand{\baselinestretch}{.5}
+\begin{document}
+\pagestyle{empty}
+\input{\figsrc}
+\end{document}
diff --git a/macros/latex/contrib/familytree/doc-ja/ft-gens-ja.tex b/macros/latex/contrib/familytree/doc-ja/ft-gens-ja.tex
new file mode 100644
index 0000000000..b3784070cb
--- /dev/null
+++ b/macros/latex/contrib/familytree/doc-ja/ft-gens-ja.tex
@@ -0,0 +1,305 @@
+\iffalse
+Copyright 2022 Jiro Senju
+
+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/>.
+\fi
+
+\section{親子関係、二世代 (\texttt{ft-gens.dtx})}
+
+\DescribeMacro{\pcdef}
+\cmd{\pcdef
+ \marg{new box name}
+ \marg{parent box name}
+ \marg{child box name}
+}
+\medskip
+
+親子関係(parent-child relationship)を定義する。
+
+指定された\meta{parent box}と\meta{child box}を結線した新たなboxを
+\meta{new box name}で定義する。
+
+\meta{parent box}に指定できるのは、子へつながる線が一本だけのboxに限ら
+れる。例えば、|\maleline|(相当)の属性を与え
+|\indvdldef|で作成したboxである。
+また\meta{child box}に指定できるのは親へつながる線を持つboxに限られる。
+例えば、child markに|\biological|を指定した|\indvdldef|で作成したboxである。
+
+|\pcdef|は次に挙げる|\gensdef|の簡易版である。
+\bigskip
+
+\DescribeMacro{\gensdef}
+\cmd{\gensdef
+ \marg{new box name}
+ \marg{parent box name}
+ \marg{list of connection-pair}
+}
+\smallskip
+
+\cmd{connection-pair :=\\
+\hspace{4em}\marg{individual box name in the parent box}\\
+\hspace{4em}\marg{child box name}
+}
+\medskip
+
+二世代の関係(generations)を定義する。
+
+\meta{connection-pair}とは、以下のものを組にしたものである。
+
+\begin{enumerate}
+\item
+ \marg{parant box}内の人物box名
+\item
+ \marg{child box}名
+\end{enumerate}
+
+この二つのboxの\meta{box name}|nameCY|同士を結線する。
+\smallskip
+
+\meta{child box}には、前述の|\pcdef|同様に、親へつながる線を(一本)持
+つboxしか指定できないが、\meta{parent box}には子へつながる線を複数
+持つものでも指定できる。どの線とどの\meta{child box}をつなぐかを指定す
+るのが\meta{connection-pair}である。
+
+作成したboxのchild markは親boxのそれに一致する。
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\clearpage
+\subsection{例}
+
+\begin{enumerate}
+\itemsep=\bigskipamount
+\item
+\srcfig{fig3Hidetada}
+
+\clearpage
+\item
+\srcfig{fig3Ietsuna}
+
+\clearpage
+\item
+上例二つをつなぐ手順を紹介しておく。
+\begin{enumerate}
+\item
+子から順に先祖を辿りながら定義する。すなわち、上例2の後に1を定義する。
+
+\item
+上例2に変更は不要である。
+
+\item
+上例1の
+
+\begin{lstlisting}[xleftmargin=1em]
+\pcdef{秀忠親子}{秀忠}{秀忠の子}
+\end{lstlisting}
+
+を
+
+\begin{lstlisting}[xleftmargin=1em]
+\gensdef{家光家綱}{秀忠の子}{%
+ {家光}{家綱綱吉}%
+}
+\pcdef{秀忠家光}{秀忠}{家光家綱}
+\end{lstlisting}
+
+へ変更する。
+\medskip
+
+すなわち
+\textgt{\texttt{\textbackslash\kern0pt 秀忠の子}}box
+内の人物box
+\textgt{\texttt{\textbackslash\kern0pt 家光}}
+と、上例2で定義済みの
+\textgt{\texttt{\textbackslash\kern0pt 家綱綱吉}}box
+をつなぎ、これを
+\textgt{\texttt{\textbackslash\kern0pt 家光家綱}}box
+とする。
+
+\textgt{\texttt{\textbackslash\kern0pt 秀忠}}box
+と親子関係を結ぶのはこの
+\textgt{\texttt{\textbackslash\kern0pt 家光家綱}}box
+である。
+
+\item
+新たに定義した
+\textgt{\texttt{\textbackslash\kern0pt 秀忠家光}}
+を描画する。
+\end{enumerate}
+
+紙面の都合上、横書きの結果のみ提示する。
+\end{enumerate}
+\smallskip
+
+\noindent\includegraphics[scale=.95]{fig3IemitsuY.pdf}
+\medskip
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\subsection{複数boxの定義、結線順序}
+\label{sec:Lily1}
+
+兄弟姉妹boxとは複数の人物boxを同列に並べるものととらえるならば、
+それと直交する方向に並べるのが親子boxだ。
+同列に並んだ兄弟姉妹それぞれが子を持つならば、親子関係が複数になるので
+単純に親子関係ボックスとは呼びづらく、二世代boxと呼ぶ方がふさわしい。
+
+このような図の作成方法は二通り考えられる。親子関係を複数定義し、親同士を
+兄弟姉妹boxでつなぐ方法と、逆に親世代の兄弟姉妹boxを先に定義してから、それぞ
+れに子をつなぐ方法だ。
+この二つの方法を比較しながら、図の見やすさを考える。まず例を図示する。
+
+\begin{enumerate}
+\needspace{2\baselineskip}
+\item
+二組の親子関係を定義後、親世代の姉妹関係を定義する。
+
+\srcfig{fig3Lily1}
+
+\needspace{3\baselineskip}
+\item
+姉妹関係を定義後、それぞれの親子関係を定義する。
+
+\srcfig{fig3Lily2}
+\end{enumerate}
+
+見て分かる通り、1の方法では子をつなぐ線の長さが異なり、更に子世代の位
+置も揃わなくなるため、見にくい図となる。
+これは子へつながる線はもっとも長いものに揃えるという|\sblngdef|の
+機能が働かなかったためだ。|\sblngdef|の引数に渡された時点で既に
+親子関係が定義されている状態であり、線の先には人物boxがつながれている。
+この状態で|\sblngdef|が強引に線を延ばすのはよろしくない。
+
+一方、2の方法では|\sblngdef|の引数は|\indvdldef|されただけで他にはつながれていない
+boxである。このため、上から長い線を描き足しても害は無い。既定義boxを改変
+しないまま、兄弟姉妹boxに閉じた範囲で同じ高さに線を上書きしている。
+
+1の方法を採った場合でも線の長さを揃える方法はある。
+|\indvdldef|が持つ線長の増減機能を利用し、
+上図のLilyが持つ|\femaleline|(|\matrilineal|)の長さをPetuniaのそれと同
+じにすれば良い。
+PetuniaとLilyの名前の長さの差を求め、それを|\indvdldef|にオプションとし
+て追加する。
+描画結果は上例2と同じである。
+\smallskip
+
+\srcfig{fig3Lily3}
+\medskip
+
+|\nameboxcfg|には子をつなぐ線の長さを変更する機能があるので、これを使っ
+ても同様の結果を得ることができる。しかし、|\indvdldef|する度に
+|\nameboxcfg|するのは得策ではないだろう。|\nameboxcfg|はもっと広範囲に
+適用する値を変更し、個別設定の回数を削減することを目的としており、
+|\indvdldef|の度に変更することは想定していない(できなくはないが)。
+個別に使用する値は|\indvdldef|のオプション引数を使用した方が簡便だろう。
+\bigskip
+
+もう一つの方法としてLilyの名前の長さをPetuniaのそれに揃える方法もある。
+この方法ではLilyの名前と線の間が空き、線の長さが揃う。
+\smallskip
+
+\srcfig{fig3Lily4}
+\medskip
+
+Lilyの親子boxをPetunia親子boxとは違う場面で使用すると、名前の後ろが不
+自然に空き、おかしく見えることもあるかもしれない。その場合は、空き具合
+を変化させたLily boxを複数定義し使い分けることになるだろう。
+\bigskip
+
+boxの定義順序、言い換えれば配置\jslash 結線順序には注意が必要だ。
+本パッケージでのbox定義とは与えられた複数のboxを並べ線でつなぐものだが、
+その際に与えられたboxの大きさを考慮する。例えば兄弟姉妹boxを定義する際、
+既に子孫とつないだboxを与え、そのboxの幅(または高さ)が増加していれば、
+兄弟姉妹の間隔を拡げる。すなわちinterval boxによる間隔挿入が必要になる
+のは末端の関係定義だ
+けになる。しかし、兄弟姉妹boxを定義した後で子とつなげる場合は、この
+間隔調整機能が発揮されない。隣り合う子boxの幅(または高さ)が広ければ、
+重なってしまうだろう。この場合は手動でinterval boxを挿入せざるを得ない。
+
+接続ポイントは\meta{box name}\meta{brabra}|nameCY|などの名前で定義され
+た座標で
+ある。前章までで説明したように|\sblngdef|は兄弟姉妹それぞれの名前の中
+心を表すY座標を定義するが、nestした場合にnest内部までは定義しない。す
+なわち親子boxに配置された人物boxへ線をつなげるのは(ほぼ)自動的にでき
+るが、親子box内の兄弟姉妹boxに配置された人物boxへ線をつなげるには、ユー
+ザが自分で座標を算出しなければならない。不可能ではないが、手間はかかる。
+この手間を回避するため、世代は下から順に定義\jslash 結線していくのが良いと考える。
+\iffalse
+\bigskip
+
+最終的に、
+ユーザがどのような図を欲するにより、どの順序でboxを定義し、つなげるか、
+また調整をどう加えるかを決定するのが良い。
+\fi
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\iffalse
+% \subsubsection{二世代box --- core}
+%
+% \iffalse
+% \parag{カスタマイズ}
+%
+% \DescribeMacro{\ftgescfg}
+% \NoDescription
+% \begin{macrocode}
+% \newcommand{\ftgenscfg}[1]{%
+% }
+% \end{macrocode}
+% \fi
+%
+% \parag{connection pair}
+%
+% \DescribeMacro{\ft@getpair}
+% 引数からconnection-pairを取り出し、
+% 親box内の接続点を|\ft@cpoint|として、また子box名を|\ft@kids|として定義する。
+% 接続点に与えられたものが親box内でnestして配置された場合にも対応する。
+% しかしnestは一段までしか対応しない。
+%
+% \parag{上余白}
+%
+% \DescribeMacro{\def@calc@xtop}
+% 親boxに必要な上余白を算出し、指定されたglobalな名前で定義する。
+%
+% \parag{下余白}
+%
+% \DescribeMacro{\ft@calc@xbottom}
+% 親boxに必要な下余白を算出し、指定されたglobalな名前で定義する。
+% 同時に|\ft@depth|も定義する。
+%
+% \parag{box size算出}
+%
+% \DescribeMacro{\ft@gens@size}
+% box sizeを算出する。
+%
+% \parag{配置}
+%
+% \DescribeMacro{\ft@gens@layout}
+% 親boxと子boxを配置する。
+% 配置した親boxの|nameCY|座標を\meta{box name}|nameCY|とする。
+% 配置した子boxの原点(左下、縦書きならば中央上)を\meta{box
+% name}\meta{\kern0pt 子box name}|Y|として定義する。
+% 本package自身では不要の座標だが、ユーザが必要とするかもしれないので。
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \subsubsection{二世代box --- interface}
+%
+% \DescribeMacro{\ftgensdef}
+% boxのchild markは親boxのそれに一致する。
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \subsubsection{親子box --- interface}
+%
+% \DescribeMacro{\ftpcdef}
+% 親子関係boxを定義する。
+% |\gensdef|の簡易版。
+% 親box、子boxそれぞれの\meta{box name}|nameCY|同士を結線する。
+\fi
diff --git a/macros/latex/contrib/familytree/doc-ja/ft-individual-ja.tex b/macros/latex/contrib/familytree/doc-ja/ft-individual-ja.tex
new file mode 100644
index 0000000000..a8b2ad3090
--- /dev/null
+++ b/macros/latex/contrib/familytree/doc-ja/ft-individual-ja.tex
@@ -0,0 +1,456 @@
+\iffalse
+Copyright 2022 Jiro Senju
+
+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/>.
+\fi
+
+\section{人物 (\texttt{ft-individual.dtx})}
+
+\DescribeMacro{\indvdldef}
+\cmd{\indvdldef
+ \oarg{child mark}
+ \marg{new box name}
+ \oarg{title}
+ \marg{individual name}
+ \oarg{additonal info}
+ \oarg{maleline xlength}
+}
+\medskip
+
+与えられた情報を整形\jslash 配置したboxを、指定された\meta{new box name}で定義する。
+
+\begin{enumerate}
+\item \oarg{child mark}
+\par
+人物名の前に描く線の種別を指定する。
+後述する|\ftbiological|、
+|\ftadopted|、
+|\fttop|、
+|\ftblank|
+のいづれかを指定する
+
+\item \marg{new box name}
+\par
+定義するbox名。
+\CS ではない
+(baskslashを付けない)
+
+\item \oarg{title}
+\par
+肩書き
+\par
+人物名の肩に二回り小さなサイズ(|\relsize{-2}|)で配置される
+
+\item \marg{individual name}
+\par
+人物名
+
+\item \oarg{additonal info}
+\par
+付加情報
+\par
+生没年、別名等、任意の情報を追加できる。
+人物名の次段に一回り小さなサイズ(|\relsize{-1}|)で配置される。
+更に後述する
+|\ftmaleline| (|\ftfemaleline|, |\ftpatrilineal|, |\ftmatrilineal|)、
+|\fthaschild|、
+|\ftprivate|
+の属性も指定できる
+
+\item \oarg{maleline xlength}
+\par
+人物名から子への線を描く場合
+(図に婚姻関係を含めない場合)、
+線の長さを増減する。
+但し、後述する兄弟姉妹box内では自動的に調節されるため、
+意味を失う。
+\end{enumerate}
+
+更に後で使用する座標(単位は|pt|)を表す\CS も定義する。
+要素(人物名)に関する座標の原点はそれぞれ、
+横書きの場合はbox左下、
+縦書きの場合はbox左上である。
+
+\begin{itemize}
+\item \meta{box name}|nameX|
+\par
+配置した人物名の末尾
+
+\item \meta{box name}|nameCX|
+\par
+配置した人物名の幅の中央
+(縦書きならば高さの中央)
+
+\item \meta{box name}|nameCY|
+\par
+配置した人物名の高さの中央
+(縦書きならば幅の中央)
+\end{itemize}
+\bigskip
+
+\needspace{4\baselineskip}
+\oarg{child mark}には次の値のいづれかを指定する。
+
+\begin{itemize}
+\item |\biological|, |\ftbiological|
+\par
+人物名の前に実子を意味する実線を描く。
+
+\item |\adopted|, |\ftadopted|
+\par
+人物名の前に養子を意味する二重線を描く。
+
+\item |\fttop| (|\top|)
+\par
+線を描かない。系図の最上位に用いる。
+
+\item |\blank|, |\ftblank|
+\par
+線を描かない代わりに、同じサイズの空白を挿入する。後述する
+|\mrrgdef|に指定する配偶者などの定義時に使用する。
+\end{itemize}
+\bigskip
+
+\oarg{additonal info}には次の属性を含められる。
+
+\begin{itemize}
+\item |\haschild|, |\fthaschild|
+\par
+子をもうけた配偶者を表す。
+\par
+後述する婚姻関係定義に使用すると、婚姻
+関係を意味する二重線から直角に実線を描く。
+
+\item |\private|, |\ftprivate|
+\par
+法的な婚姻関係ではないことを表す。
+\par
+後述する婚姻関係定義に使用する
+と、婚姻関係を意味する二重線を点線にする。
+
+\item |\maleline|, |\ftmaleline|
+\par
+婚姻線を描かず人物名から子への線を描く。
+\par
+線の長さはオプション引数\meta{maleline xlength}で加減できる。
+|\ftfemaleline|、
+|\ftpatrilineal|、
+|\ftmatrilineal|と同義。
+\end{itemize}
+\bigskip
+
+作成するboxの中身は細分化されたboxである。
+\smallskip
+
+\begin{itemize}
+\item 肩書きを表す|\ft@titlebox|
+\item 人物名を表す|\ft@namebox|
+\par
+内部には更に\meta{child mark}を表す|\ft@cmarkbox|、
+\meta{maleline}を表す\allowbreak|\ft@malelinebox|がある。
+\item 付加情報を表す|\ft@optbox|
+\end{itemize}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\subsection{カスタマイズ}
+
+配置を調整する機能もある。
+変更しないものには空を指定すれば良い。
+大したことはしていないので必要に応じ参照\jslash 使用する程度で良い。
+引数等詳細は実装を参照のこと。
+\medskip
+
+\needspace{1.5\baselineskip}
+\DescribeMacro{\nameboxcfg}
+\cmd{\nameboxcfg
+ \marg{space from the child mark}
+ \marg{font}
+ \marg{space to the maleline}
+ \marg{maleline length}
+}
+\smallskip
+
+\DescribeMacro{\cmarkboxcfg}
+\cmd{\cmarkboxcfg
+ \marg{space between two lines, for adopted}
+ \marg{line length}
+}
+\smallskip
+
+\DescribeMacro{\titleboxcfg}
+\cmd{\titleboxcfg
+ \marg{indent}
+ \marg{font}
+ \marg{linestretch}
+ \marg{vspace to the individual name}
+}
+\smallskip
+
+\DescribeMacro{\optboxcfg}
+\cmd{\optboxcfg
+ \marg{vspace from the individual name}
+ \marg{indent}
+ \marg{font}
+ \marg{linestretch}
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\subsection{例}
+
+\begin{enumerate}
+\itemsep=\bigskipamount
+\item
+\srcfig{fig1base}
+
+\item
+\srcfig{fig1Ieyasu}
+
+\item
+\srcfig{fig1Hidetada}
+\end{enumerate}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\iffalse
+\subsectImpl
+
+\subsubsection{child-mark box}
+
+\parag{カスタマイズ}
+
+\DescribeMacro{\ftcmarkboxcfg}
+\DescribeMacro{\cmarkboxcfg}
+child markを配置したboxを生成する際に使用する
+|\adopted|の二重線の間隔、
+線の長さ
+をカスタマイズできる。
+
+変更しないものには空を指定すれば良い。
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\parag{box生成}
+
+\DescribeMacro{\fttop}
+\DescribeMacro{\top}
+\DescribeMacro{\ftbiological}
+\DescribeMacro{\biological}
+\DescribeMacro{\ftadopted}
+\DescribeMacro{\adopted}
+\DescribeMacro{\ftblank}
+\DescribeMacro{\blank}
+child mark種類。
+それぞれの意味は\refnm{table:cmark}を参照。
+
+\DescribeMacro{\ft@indvdl@nameH}
+\DescribeMacro{\ft@indvdl@nameD}
+\DescribeMacro{\ft@indvdl@nameCY}
+\DescribeMacro{\ft@do@cmarkdef}
+\DescribeMacro{\ft@cmarkdef}
+指定された\meta{cmark}を持つboxを、\meta{cmarkbox-name}に指定された名前で生
+成する。
+
+罫線文字を使うことも検討したが、fontが異なるとつながらなくなる恐れがあ
+るため|picutre|の|line|にした。
+
+|\ft@indvdl@nameH|、|\ft@indvdl@nameD|、|\ft@indvdl@nameCY|はinterface
+である|\indvdldef|が初期化する。
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\subsubsection{付加情報box}
+
+\parag{カスタマイズ}
+
+\DescribeMacro{\ftoptboxcfg}
+\DescribeMacro{\optboxcfg}
+付加情報\meta{additional info}を整形\jslash 配置した|\ft@optbox|を生
+成する際に使用する、
+人物名との距離、
+字下げ量、
+font、
+linestretch
+をカスタマイズできる。
+
+変更しないものには空を指定すれば良い。
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\parag{属性と付加情報の解析}
+
+\DescribeMacro{\ftmaleline}
+\DescribeMacro{\maleline}
+\DescribeMacro{\fthaschild}
+\DescribeMacro{\haschild}
+\DescribeMacro{\ftprivate}
+\DescribeMacro{\private}
+属性。
+それぞれの意味は\refnm{table:attrib}を参照。
+
+\DescribeMacro{\ft@optlist}
+\meta{option-list}に指定された付加情報\meta{additional info}から属性を取り出し、
+\meta{box-name}を基にした名前のglobal flagを定義する。
+属性以外のものは後で印字するため、
+別リスト\meta{list}を生成する。
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\parag{box生成}
+
+\DescribeMacro{\ft@opt}
+付加情報\meta{additional info}を整形\jslash 配置した|\ft@optbox|を生
+成する。
+
+先頭には\meta{child-mark}分に加え、
+人物名からindentするための余白を挿入する。
+
+最終行のdepthをboxのdepthとする。
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\subsubsection{人物名box}
+
+\parag{カスタマイズ}
+
+\DescribeMacro{\ftnameboxcfg}
+\DescribeMacro{\nameboxcfg}
+人物名に使用する、
+字下げ量、
+font、
+人物名の後にmalelineを描く場合の人物名との距離、
+および線の長さ
+をカスタマイズできる。
+
+変更しないものには空を指定すれば良い。
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\parag{box生成}
+
+\DescribeMacro{\ft@name}
+人物名を整形\jslash 配置した|\@ft@namebox|を生成する。
+
+中身は|\ft@cmarkbox|、\meta{individual-name}、
+|\ft@malelinebox|を並べたもの。
+
+malelineを描く場合、defaultのlength、というか線の始点をどう決定するか
+を仲々決められなかった。
+始点を単に人物名の後ろとするか、それとも肩書きと付加情報も含め、一
+番大きなboxの後ろを始点とするか。後者にすると人物box単独での見た目は良
+くなる。すなわち常にmalelineを一番長くさせられる。しかし、後述する他の
+兄弟姉妹boxなどと並べる時に、線をどれだけ延ばせば他のboxと揃えられるか
+を算出するのに手間がかかるようになる。
+この点は前者の方に分があり、単に人物名のsizeの差だけを増
+加させれば揃えられる。
+試行錯誤の後、始点は前者とし、default lengthは
+|\ft@namebox@maleline@length|とする。
+すなわち、人物boxを単独で用いる場合、肩書きや追加情報の方がmalelineよ
+りも長くなることがあり得る。
+
+後で兄弟姉妹\jslash 親子\jslash 婚姻関係作成時に座標として利用できるよう、
+\meta{box name}|nameX|、\meta{box name}|nameCX|を定義する。
+
+人物boxのdepthは人物名のそれに一致させる。
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\subsubsection{肩書きbox}
+
+\parag{カスタマイズ}
+
+\hyphenation{line-stretch}
+\DescribeMacro{\fttitleboxcfg}
+\DescribeMacro{\titleboxcfg}
+肩書きを配置した|\ft@titlebox|を生成する際に使用する
+字下げ量、
+font、
+linestretch、
+人物名との距離をカスタマイズできる。
+
+変更しないものには空を指定すれば良い。
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\parag{box生成}
+
+\DescribeMacro{\ft@title}
+肩書きを整形\jslash 配置した|\ft@titlebox|を生成する。
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\subsubsection{boxの連結 --- core}
+
+指定された情報を基に、
+肩書き(|\ft@titlebox|)、人物名(|\ft@namebox|)、付加情報
+(|\ft@optbox|)それぞれを作成する。
+それらを並べ人物boxを生成する。
+boxのdepthは最終行のそれに一致させる。
+
+後で兄弟姉妹\jslash 婚姻\jslash 親子関係作成時に座標として利用できるよう、
+\meta{box name}|nameCY|を定義する。
+
+各boxの生成、人物boxのsize算出、|picture|によるlayoutの三段階を踏む。
+それぞれを独立させ定義するが、\IhadtoSplit
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\parag{各boxの生成}
+
+\DescribeMacro{\ft@indvdlbox@gen}
+\NoDescription
+ \begin{macrocode}
+ \end{macrocode}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\parag{人物boxのsize算出}
+
+\DescribeMacro{\ft@indvdlbox@calc}
+\NoDescription
+ \begin{macrocode}
+ \end{macrocode}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\parag{\texttt{picture}によるlayout}
+
+\DescribeMacro{\ft@indvdlbox@layout}
+\NoDescription
+ \begin{macrocode}
+ \end{macrocode}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\parag{box連結のmain}
+
+\DescribeMacro{\ft@indvdlbox}
+\NoDescription
+ \begin{macrocode}
+ \end{macrocode}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\subsubsection{人物box --- interface}
+
+\DescribeMacro{\ftindvdldef}
+\DescribeMacro{\indvdldef}
+指定された情報に従い、
+\meta{box name}という名前のboxを生成する。
+
+\meta{individula name}だけの高さ|\ft@indvdl@nameH|を求め、
+更にdepthも考慮した中点を|\ft@indvdl@nameCY|に定義し、
+以降の接続点の座標算出に用いる。
+
+\meta{child mark}は人物boxの先頭に置き、
+全ての行はlayout的にその存在を意識する必要があるため、
+他の項目よりも先に決定し、
+|\ft@cmarkbox|、
+およびその幅を表す|\ft@cmarkW|を定義する。
+
+\meta{cmark}が|\ftblank|以外の場合は、
+child-markが存在することを表すglobal flagを
+\meta{containerbox-name}に指定された名前を基に定義する。
+
+|\ft@optlst|により\meta{additional info}を解析し、
+属性を除いたものを|\ft@indvdl@opts|にまとめる。
+同時に|\ifft@maleline|を設定し、
+属性に|\maleline|が指定されているか否かを以降判断できるようにする。
+
+ここまでの前処理を済ませた後|\ft@indvdlbox|により人物名boxを生成する。
+\fi
diff --git a/macros/latex/contrib/familytree/doc-ja/ft-lib-ja.tex b/macros/latex/contrib/familytree/doc-ja/ft-lib-ja.tex
new file mode 100644
index 0000000000..fc0e647c41
--- /dev/null
+++ b/macros/latex/contrib/familytree/doc-ja/ft-lib-ja.tex
@@ -0,0 +1,86 @@
+\iffalse
+Copyright 2022 Jiro Senju
+
+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/>.
+\fi
+
+\section{library (\texttt{ft-lib.dtx})}
+
+本文書中最後の章ではあるが、
+|ft-lib.dtx|は|sty|内では先頭に位置する。
+
+\iffalse
+% \DescribeMacro{\ft@unit}
+% 一文字の横幅を表す(日英対応)。
+%
+% \DescribeMacro{\if@tate}
+% |\if@tate|が定義されていないdocumentclassに対応する。
+% 効果は未確認。
+%
+% \DescribeMacro{\ft@alias}
+% prefix |ft|を除外したaliasを定義する。名前が使えなければ諦めて
+% |message|する。
+% なんでこんなに沢山|\expandafter|が必要になるのか理解できていない。
+\fi
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\subsection{utility}
+
+\DescribeMacro{\ftymd}
+\DescribeMacro{\ymd}
+\cmd{\ftymd
+ \marg{year}
+ \oarg{month}
+ \oarg{date}
+}
+
+年月日を整形、印字する。縦書きにも対応している。
+|\indvdldef|の付加情報での利用を想定している。
+\bigskip
+
+\DescribeMacro{\ftundef}
+\cmd{\ftundef
+ \marg{box name}
+}
+
+名前に\meta{box name}を持つものを全て未定義とする。
+prefix |ft|なしのaliasは設けない。
+
+\iffalse
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \subsubsection{internal library}
+%
+% \parag{global variable}
+%
+% \parag{utility function}
+%
+% \DescribeMacro{\ft@namexdef}
+% \DescribeMacro{\ft@namexdefstrip}
+%
+% \DescribeMacro{\ft@savenamebox}
+% \DescribeMacro{\ft@newnamebox}
+%
+% \DescribeMacro{\ft@nameboxsz}
+% \DescribeMacro{\ft@boxsz}
+%
+% \DescribeMacro{\ft@list@append}
+%
+% \parag{debugging}
+%
+% \DescribeMacro{\ifftdbg}
+% \DescribeMacro{\ft@dbgmsg}
+% \DescribeMacro{\ft@dbgframe}
+% \DescribeMacro{\ft@dbgplot}
+% \DescribeMacro{\ft@dbgbox}
+\fi
diff --git a/macros/latex/contrib/familytree/doc-ja/ft-marriage-ja.tex b/macros/latex/contrib/familytree/doc-ja/ft-marriage-ja.tex
new file mode 100644
index 0000000000..1076439f99
--- /dev/null
+++ b/macros/latex/contrib/familytree/doc-ja/ft-marriage-ja.tex
@@ -0,0 +1,219 @@
+\iffalse
+Copyright 2022 Jiro Senju
+
+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/>.
+\fi
+
+\section{婚姻関係 (\texttt{ft-marriage.dtx})}
+
+\DescribeMacro{\mrrgdef}
+\cmd{\mrrgdef
+ \marg{new box name}
+ \marg{spouse list A}
+ \marg{oneself}
+ \marg{spouse list B}
+ \oarg{childline xlength}
+}
+\medskip
+
+指定された\meta{new box name}でboxを定義する。
+再婚や側室などにも対応するべく、配偶者はlist形式で指定する。
+|\indvdldef|で定義したboxの名前をカンマ区切りのlistとして与える。
+\meta{spouse list A}は本人(\meta{oneself})の上側(縦書きならば右)に、
+\meta{spouse list B}は本人(\meta{oneself})の下側(縦書きならば左)に、
+それぞれ配置する。
+いづれも\CS ではない点に注意
+(冒頭にbackslashを含まない)。
+\smallskip
+
+全員を同列に並べ、正式な婚姻関係は二重実線で、正式でなければ
+(|\private|属性)
+二重点線で結ぶ。
+二重線の位置は\meta{oneself}の人物名の中点とする。
+\smallskip
+
+子をもうけた夫婦
+(配偶者が|\haschild|属性を持つ)
+間の二重線からは子をつなぐ線を描く。
+\smallskip
+
+|\sblngdef|同様に間隔を空ける場合はinterval boxを挿入できる。
+\medskip
+
+|\indvdldef|同様に、後で使用する座標(単位は|pt|)を表す\CS も定義する。
+座標の原点はそれぞれ、
+横書きの場合はbox左下、
+縦書きの場合はbox左上である。
+
+\begin{itemize}
+\item \meta{box name}|nameCY|
+\par
+婚姻関係box内での本人(\meta{oneself})の人物名の高さの中央
+(縦書きならば幅の中央)
+
+\item \meta{box name}\meta{\kern0pt 人物box name}|nameCY|
+\par
+婚姻関係box内でのcmarkを持つ人物名の高さの中央
+
+\item \meta{box name}\meta{\kern0pt 人物box name}|mrrgCY|
+\par
+婚姻関係box内での|\haschild|属性を持つ人物名と婚姻線との中点
+\end{itemize}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\subsection{カスタマイズ}
+
+% 配置を調整する機能もある。
+% 変更しないものには空を指定すれば良い。
+% 大したことはしていないので必要に応じ参照\jslash 使用する程度で良い。
+% 引数等詳細は実装を参照のこと。
+% \medskip
+
+\DescribeMacro{\mrrgboxcfg}
+\cmd{\mrrgboxcfg
+ \marg{space between two lines}
+ \marg{space between name and the line}
+ \marg{line length}
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\clearpage
+\subsection{例}
+
+\begin{enumerate}
+\item
+\srcfig{fig4Hidetada}
+\clearpage
+
+\item
+\srcfig{fig4Ogou}
+\end{enumerate}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\subsection{同世代内の配置と結線}
+
+一つの\FamilyTree になんでもかんでも詰め込むのは無理がある。
+
+例えば夫婦がともに再婚していた場合、全員を同列に並べては見にく
+くなるばかりだ。先に挙げた二つの図は秀忠夫婦を表すと言えば同じになって
+しまうが、観点を秀忠にするかお江にするかで随分違う図になる。この二つの
+図を合体させるのはまず無理と
+思う。人物を減らすか、夫婦それぞれを主人公にした図の二つに分けるしかない。
+それでも自身の先祖や子孫が配偶者側の先祖\jslash 子孫と関係を
+持つ場合があれば、更に分割せざるを得ないだろう。
+
+兄弟姉妹関係と婚姻関係を同時に表現する場合も同様だ。
+同世代内で線が入り乱れると図が見にくくなってしまう。
+\refnm{sec:Lily1}の例を再利用し考えてみる。
+
+Petunia -- Lily姉妹がそれぞれ結婚した場合、姉妹関係と婚姻関係を同時に、
+かつ綺麗に表現できるだろうか。
+
+まず二組の夫婦を定義し、後に姉妹関係を定義する。
+\bigskip
+
+\srcfig{fig4Lily1}
+\medskip
+
+夫婦単位で見れば問題はないかもしれないが、姉妹関係を結ぶと見づらい図となってし
+まう。原因になりうる点は次の三つだろう。
+
+\begin{enumerate}
+\item 婚姻関係を表す二重線の位置が揃っていない。
+\item 子をつなぐ線の長さも異なっており、この状態で子をつなぐと見づらさに
+ 拍車がかかる。
+\item JamesがPetuniaとLilyの間に割り込んでおり、姉妹関係を見づらくして
+いる。
+\end{enumerate}
+
+一点目の二重線の位置を揃えれば、二点目の線長不揃いも自動的に解消される。
+これには\refnm{sec:Lily1}でも紹介した、Lily boxの幅をPetunia boxのそれ
+に揃える方法が使える。
+三点目のJamesの位置だが、まずは間隔を拡げてみる。
+\bigskip
+
+\srcfig{fig4Lily2}
+\medskip
+
+間隔を拡げても姉妹線がJamesを跨いでいることは変わらない。見づらさは改
+善されただろうか?
+更に改善するにはJamesとLilyの順序を入れ替えるしかない。
+\bigskip
+
+\srcfig{fig4Lily3}
+\medskip
+
+入れ替えた上で間隔を拡げるのも一つの手だ。
+\bigskip
+
+\srcfig{fig4Lily4}
+\medskip
+
+これがbestだろうか?
+見やすさ\jslash 見にくさは主観や好みが強く出る所だ。
+個人的には夫婦の順序が変わっている点に抵抗を覚える。だが、姉妹に観点を
+置いた\FamilyTree ならば、この形も有りだと認めざるを得ない。系図内の他
+の部分とのバランスもあるので、最終的には総合的に判断するものだろう。
+婚姻関係を含めない\Matrilineal 図も積極的に検討したい。
+
+\iffalse
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \parag{カスタマイズ}
+%
+% \DescribeMacro{\ftmrrgboxcfg}
+% \DescribeMacro{\mrrgboxcfg}
+% 婚姻boxを生成する際に使用する
+% 二重線の間隔、
+% 二重線と人物名との距離、
+% 二重線の長さ
+% をカスタマイズできる。
+%
+% 変更しないものには空を指定すれば良い。
+%
+% \parag{解析}
+%
+% \DescribeMacro{\ft@mrrg@parse}
+% 引数を解析し、婚姻boxのsizeを算出する。
+%
+% 子につながる線を描く場合、一番長いものに
+% |\ft@namebox@maleline@length|を加えた長さに揃える。
+%
+% \parag{婚姻関係線の描画}
+%
+% \DescribeMacro{\ft@mrrg@line}
+% 本人と配偶者を二重線でつなぐ。
+%
+% 配偶者が|\haschild|属性を持っていれば、二重線の中点から子へつなぐため
+% の線も描き、その座標を\meta{box name}\meta{\kern0pt 人物box name}|mrrgCY|に定
+% 義する。
+%
+% \parag{人物名の配置}
+%
+% \DescribeMacro{\ft@mrrg@name}
+% child mark属性を持つ人物boxの場合は、\meta{box name}\meta{\kern0pt 人物box
+% name}|nameCY|を定義する。
+%
+% \subsubsection{人物boxの配置と結線 --- core}
+%
+% \DescribeMacro{\ft@mrrg@spouse}
+% 配偶者list内の要素それぞれを配置し、婚姻関係線を描く。
+%
+% \subsubsection{婚姻box --- interface}
+%
+% \DescribeMacro{\ftmrrgdef}
+% \DescribeMacro{\mrrgdef}
+% 配置したbox内での本人(\meta{oneself})の|nameCY|を、\meta{box name}|nameCY|と
+% して定義する。同様に本人の|hascmark|をそのまま\meta{box
+% name}|hascmark|とする。
+\fi
diff --git a/macros/latex/contrib/familytree/doc-ja/ft-sibling-ja.tex b/macros/latex/contrib/familytree/doc-ja/ft-sibling-ja.tex
new file mode 100644
index 0000000000..00567f863a
--- /dev/null
+++ b/macros/latex/contrib/familytree/doc-ja/ft-sibling-ja.tex
@@ -0,0 +1,181 @@
+\iffalse
+Copyright 2022 Jiro Senju
+
+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/>.
+\fi
+
+\section{兄弟姉妹関係 (\texttt{ft-sibling.dtx})}
+
+\DescribeMacro{\sblngdef}
+\cmd{\sblngdef
+ \marg{new box name}
+ \marg{name list of individual boxes}
+}
+\medskip
+
+|\indvdldef|で定義したboxの名前をカンマ区切りのlistとして与える。
+同列に並べ、兄弟姉妹間を線でつないだboxを、
+指定された\meta{new box name}で定義する。
+いづれも\CS ではない点に注意
+(冒頭にbackslashを含まない)。
+
+指定された兄弟姉妹の内、|\maleline|属性を持つ者が複数在れば、一番長い
+ものに線の長さを揃える。
+\smallskip
+
+|\indvdldef|同様に、後で使用する座標(単位は|pt|)を表す\CS も定義する。
+座標の原点はそれぞれ、
+横書きの場合はbox左下、
+縦書きの場合はbox左上である。
+
+\begin{itemize}
+\item \meta{box name}|nameCY|
+\par
+兄弟姉妹達をつなぐ線の中央
+\par
+兄弟姉妹間をつなぐ線とはすなわち\meta{list先頭box}|nameCY|と\meta{list
+末尾box}|nameCY|をつなぐ線である。
+
+\item \meta{box name}\meta{\kern0pt 人物box name}|nameCY|
+\par
+兄弟姉妹box内での人物名それぞれの高さの中央
+(縦書きならば幅の中央)
+\par
+|\indvdldef|が定義した\meta{\kern0pt 人物box name}|nameCY|が
+兄弟姉妹box内での人物名に合わせて平行移動したとも言える。
+\end{itemize}
+\bigskip
+
+\DescribeMacro{\ivaldef}
+\cmd{\ivaldef
+ \marg{new box name}
+ \marg{length}
+}
+\medskip
+
+\FamilyTree では兄弟姉妹の子孫が多い場合等、
+兄弟姉妹間の間隔を拡げる事がある。
+このような場合には|\ivaldef| (interval box)
+で生成した、中身が空のboxを手動で挿入する。
+このpackageでは予め三つのboxを定義してある。
+|\ival|、|\ivali|、|\ivalii|であり、
+中身は空だがそれぞれ|0.5zw|、|1zw|、|2zw|のlengthを持つ
+(厳密に言うと、日英対応のため|1zw|を|\ft@unit|として再定義しており、ここ
+ では|.5\ft@unit|、|1\ft@unit|、|2\ft@unit|のinterval boxとしている)。
+
+|\ivaldef|は|\global\newsavebox|するので、
+乱発しては資源消費が問題になる恐れがある。
+その場合は後述する|\sblngboxcfg|で全ての兄弟姉妹間に同じ間隔を設ければ問題
+を回避できる。または、小さな空白を複数連続して挿入することも可能であ
+る。
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\subsection{カスタマイズ}
+
+% 配置を調整する機能もある。
+% 大したことはしていないので必要に応じ参照\jslash 使用する程度のもの。
+% 引数等詳細は後述する。
+% \smallskip
+
+\DescribeMacro{\sblngboxcfg}
+\cmd{\sblngboxcfg
+ \marg{space between the siblings}
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\subsection{例}
+
+\begin{enumerate}
+\itemsep=\bigskipamount
+\item
+\srcfig{fig2base}
+
+\item
+\srcfig{fig2Hidetada}
+
+\item
+\srcfig{fig2ival}
+
+\needspace{5\baselineskip}
+\item
+\srcfig{fig2cfg}
+\end{enumerate}
+
+\iffalse
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \subsubsection{interval box}
+%
+% \DescribeMacro{\ftivaldef}
+% \DescribeMacro{\ivaldef}
+% サイズは持つが中身が空のboxを生成する。
+% 兄弟姉妹間に隙間として挿入する際に使用する。
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \parag{pre-defined interval boxes}
+%
+% \DescribeMacro{\ftival}
+% \DescribeMacro{\ival}
+%
+% \DescribeMacro{\ftivali}
+% \DescribeMacro{\ivali}
+%
+% \DescribeMacro{\ftivalii}
+% \DescribeMacro{\ivalii}
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \parag{カスタマイズ}\
+%
+% \DescribeMacro{\ftsblngboxcfg}
+% \DescribeMacro{\sblngboxcfg}
+% 兄弟姉妹を整形\jslash 配置したboxを生
+% 成する際に使用する兄弟姉妹間の間隔
+% をカスタマイズできる。
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \subsubsection{兄弟姉妹box --- core}
+%
+% 指定された兄弟姉妹を全て同列に並べ、関係線を結ぶ。
+% 指定された名前でboxを生成する。
+%
+% 指定された兄弟姉妹の内、|\maleline|属性を持つ者が複数在れば、一
+% 番長いものに線の長さを揃える。
+% 人物名と線の間にはここでも|\ft@namebox@maleline@sp|分の空白を設ける。
+%
+% \IhadtoSplit
+%
+% \DescribeMacro{\ft@sblng@maleline}
+% |maleline|の長さを揃える。
+%
+% \DescribeMacro{\ft@sblng@connect}
+% 兄弟姉妹間を線でつなぐ。
+%
+% 線の中点を\meta{box-name}|nameCY|として定義する。
+%
+% \DescribeMacro{\ft@sblng@layout}
+% 配置し、線でつなぐ。
+%
+% 人物名を配置した高さを\meta{box name}\meta{\kern0pt 人物box
+% name}|nameCY|として定義する。
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \subsubsection{兄弟姉妹box --- interface}
+%
+% \DescribeMacro{\ftsblngdef}
+% \DescribeMacro{\sblngdef}
+% 前処理として全体サイズを算出し、coreである|\ft@sblng@layout|を実行する。
+% memberに|\maleline|属性を持つものが居るけれど、
+% もっとも幅が広い人物boxは|\maleline|属性を持っていない場合、
+% このboxの幅を拡げ、malelineの長さを延ばす。
+% 延ばす量は|\ft@namebox@maleline@length|である。
+\fi
diff --git a/macros/latex/contrib/familytree/familytree-ja.pdf b/macros/latex/contrib/familytree/familytree-ja.pdf
new file mode 100644
index 0000000000..83fa88daac
--- /dev/null
+++ b/macros/latex/contrib/familytree/familytree-ja.pdf
Binary files differ
diff --git a/macros/latex/contrib/familytree/familytree.dtx b/macros/latex/contrib/familytree/familytree.dtx
new file mode 100644
index 0000000000..1cdc44159e
--- /dev/null
+++ b/macros/latex/contrib/familytree/familytree.dtx
@@ -0,0 +1,260 @@
+% \iffalse
+% Copyright 2022 Jiro Senju
+%
+% 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/>.
+%
+%<package>\NeedsTeXFormat{LaTeX2e}
+%<package>\ProvidesPackage{familytree}%
+%<package>[2022/06/27 v3.1 familytree]
+%
+%<*driver>
+\documentclass[draft]{ltxdoc}
+\let\Ocmd=\cmd
+\renewcommand{\cmd}[1]{%
+ %\hskip-\parindent
+ \parbox{.95\textwidth}{\Ocmd{#1}}%
+}
+%
+\input{fonts}
+%
+\usepackage[dvipdfmx,final]{graphicx}
+\usepackage[final]{listings}
+\lstset{basicstyle=\small\ttfamily,
+ language=TeX,
+ columns=[c]flexible,
+ tabsize=4,
+ %frame=tb,
+ keepspaces=true,
+ %lineskip=-.1em,
+ belowskip=\medskipamount}
+\usepackage{multicol}
+\usepackage{needspace}
+%
+% hyperref should come last
+\usepackage[dvipdfmx,final,pdfusetitle]{hyperref}
+% bookmarksdepth=section
+% pdffitwindow=true
+% pdfpagetransition=Dissolve
+% pdfstartview=FitB
+\hypersetup{
+ hyperfootnotes=false,
+ colorlinks=true,
+ linkcolor=blue,
+ % anchorcolor=black,
+ % citecolor=black,
+ % urlcolor=black,
+ bookmarks=true,
+ bookmarksnumbered=true,
+ setpagesize=false,
+ %pdftitle={},
+ %pdfauthor={},
+ pdfpagelayout=SinglePage,
+ pdfpagemode=UseOutlines,
+ pdfstartview=FitH
+}
+%
+\usepackage{\jobname}
+%
+\makeatletter
+\def\meta@font@select{\slshape}
+\def\fps@table{htbp}
+\let\part=\@gobble
+%
+\newcount\ft@lastsection
+\newcommand{\subsectImpl}[1][\subsection]{%
+ \iftrue% debugging code
+ \@tempcnta=\numexpr\thesection + 1\relax%
+ \ifnum\@tempcnta>\ft@lastsection\else%
+ Jump to \hyperlink{section.\the\@tempcnta}{next section}%
+ \fi%
+ \fi%
+ \needspace{4\baselineskip}%
+ #1{Implementation}%
+}
+\makeatother
+%
+\newcommand{\parag}[1]{%
+ \allowbreak%
+ \paragraph{#1}\nopagebreak\hskip0pt\nopagebreak%
+ %\medskip%
+}
+\newcounter{CS}[section]
+\newcommand{\CS}{%
+ \ifnum\theCS=0%
+ control sequence%
+ \stepcounter{CS}%
+ \else%
+ CS%
+ \fi%
+}
+\newcommand{\srcfig}[2][]{%
+ \lstinputlisting{\Dir/#2print}%
+ \nopagebreak[4]%
+ \hfil\includegraphics[#1]{\Dir/#2.pdf}%
+}
+\newcommand{\NoDescription}{\vspace*{-.9\baselineskip}}
+\newcommand{\IhadtoSplit}{%
+ This is not a good structure since it bogusly splits a long code into
+ a few parts, and may global variables. Comparing to the non-split
+ version, the split one is just a little better.
+}
+\let\tableautorefname=\tablename%
+\renewcommand{\subsectionautorefname}{}
+\newcommand{\refnm}[1]{%
+ \autoref{#1} ``\nameref{#1}''%
+}
+%
+% \EnableCrossrefs
+\DisableCrossrefs
+% \PageIndex
+%\CodelineIndex
+\makeatletter
+\let\theCodelineNo=\reset@font
+\AtEndDocument{%
+ \immediate\write\@auxout{%
+ \string\global\string\ft@lastsection=\thesection%
+ }%
+}
+\makeatother
+%\RecordChanges
+%
+\begin{document}
+\MakeShortVerb{\|}
+\let\PrintIndexO=\PrintIndex
+\let\PrintIndex=\relax
+\DocInput{\jobname.dtx}
+\DocInclude{ft-individual}
+\DocInclude{ft-sibling}
+\DocInclude{ft-gens}
+\DocInclude{ft-marriage}
+\DocInclude{ft-lib}
+%\PrintChanges
+% \PrintIndexO
+\end{document}
+%</driver>
+% \fi
+%
+% \GetFileInfo{\jobname.sty}
+% \title{{\spaceskip=1ex\textsf{\jobname} package \fileversion}}
+% \author{Jiro Senju\\\texttt{\small jiro1010senju AT gmail DOT com}}
+% \date{\filedate}
+% \maketitle
+%
+% Draws a Family Tree.
+%
+% Defines a box describing an individual, and connects the multiple
+% boxes by lines.
+% The line represents the sibling, the parent-child relation ship, or
+% the marriage.
+%
+% \begin{itemize}
+% \item Excluding the marriage box, you can get a maleline\slash patrilineal
+% tree, or a femaleline\slash matrilineal tree.
+% \item For Japanese, |jlreq.cls| vertical option (|tate|) is supported.
+% \end{itemize}
+% \bigskip
+%
+% \setcounter{tocdepth}{2}
+% \columnseprule=\arrayrulewidth
+% \begin{multicols}{2}
+% \tableofcontents
+% \end{multicols}
+% \bigskip
+%
+% \setcounter{secnumdepth}{0}
+% \section{Introduction}
+%
+% Family Tree is interesting.
+% But also, it can be really complicated, especially including the
+% siblings and marriages.
+%
+% Graphviz (|dot(1)|) is a good tool to draw a family tree, but I want
+% more straightforward understandability.
+% Here I try developing some macros to draw a family tree easily.
+% I am not a TeXnician, but I hope it helps someone who wants to draw
+% and view a large family tree.
+% Tested on TeX Live 2019.
+% Any comments will be appreciated.
+%
+% \subsection{Development}
+%
+% Basically all \CS s have a prefix ``|ft|''.
+% But non-prefix names are also defined by |\let| as an alias\slash
+% synonym, to improve the usability and the visibility.
+% Obviously only when the name is undefined.
+% If \CS{} name is already defined and |familytree| pkg cannot define the alias,
+% |\message| is generated.
+% This document tries using the |ft|-less alias name, but a few are used
+% with the prefixed name.
+% \smallskip
+%
+% There are multiple |dtx| files, but the generated |sty| is only one.
+% |ft-lib.dtx| is described at last of this document, but it comes
+% first in |sty|.
+% \medskip
+%
+% In the beginning, I was going to implement using |\hbox| and |\vbox|
+% or |tabular| environment. I thought they would be enough.
+% After defining the boxes, I would connect them by lines, then I got a
+% trouble.
+% |latex| adjusts the position of the boxes by inserting a glue or
+% something, and their connection points are shifted. I could not find a
+% good universal solution.
+% Can TikZ or something define the absolute coordinates and the lines? I
+% don't know.
+% To connect the lines, I had to choose |picture| environment.
+%
+% The depth of a character was another trouble, or I don't have enough
+% experience and
+% knowledge. To layout the boxes in |picture|, I have to consider the
+% depth of the box.
+% To support the Japanese in vertical mode, the depth is very important. In
+% horizontal mode, the depth is very alike of the English alphabets. But
+% in vertical mode, the depth is a half size of a character.
+% I didn't know that, and it took very long time for me.
+%
+% \subsection{Structure}
+%
+% Defines every element as a box in the tree, and connects them by lines.
+% In defining a box, we also define its connection points which make the
+% box to be connectable later.
+%
+% These are the elements.
+%
+% \begin{enumerate}
+% \item individual box
+% \begin{itemize}
+% \item child mark to represent one is adopted or biological child
+% \item one's title
+% \item one's name
+% \item maleline\slash femaleline for the patrilineal\slash matrilineal tree
+% \item additional information\par
+% birth\slash death year-month-date, nickname, or anything
+% \end{itemize}
+%
+% \item sibling box
+% \begin{itemize}
+% \item a line between the child marks
+% \item interval box to make a space between individuals
+% \end{itemize}
+%
+% \item marriage box
+% \begin{itemize}
+% \item marriage line (double line) to connect the husband and the wife
+% \end{itemize}
+%
+% \item parent-child relationship or generations box
+% \end{enumerate}
+%
+% \setcounter{secnumdepth}{3}
diff --git a/macros/latex/contrib/familytree/familytree.ins b/macros/latex/contrib/familytree/familytree.ins
new file mode 100644
index 0000000000..452085b573
--- /dev/null
+++ b/macros/latex/contrib/familytree/familytree.ins
@@ -0,0 +1,12 @@
+\input docstrip.tex
+% \keepsilent
+\askforoverwritefalse
+\generate{\file{familytree.sty}{
+ \from{familytree.dtx}{package}
+ \from{ft-lib.dtx}{package}
+ \from{ft-individual.dtx}{package}
+ \from{ft-sibling.dtx}{package}
+ \from{ft-gens.dtx}{package}
+ \from{ft-marriage.dtx}{package}
+}}
+\endbatchfile
diff --git a/macros/latex/contrib/familytree/familytree.pdf b/macros/latex/contrib/familytree/familytree.pdf
new file mode 100644
index 0000000000..f9f413e737
--- /dev/null
+++ b/macros/latex/contrib/familytree/familytree.pdf
Binary files differ
diff --git a/macros/latex/contrib/familytree/figs/Makefile b/macros/latex/contrib/familytree/figs/Makefile
new file mode 100644
index 0000000000..15612d8f80
--- /dev/null
+++ b/macros/latex/contrib/familytree/figs/Makefile
@@ -0,0 +1,76 @@
+
+Dir ?= /tmp
+export Dir
+
+include ../cmd.mk
+Lo = '\def\Dir{'${Dir}'}'
+
+Fig = $(addprefix fig1Robert, 1 2)
+Fig += fig2base fig2sis fig2ival
+Fig += $(addprefix fig3Robert, 1 2) $(addprefix fig3Lily, 1 2 3 4)
+Fig += fig4Robert fig4HenryVIII $(addprefix fig4Lily, 1 2 3 4)
+
+figPdf = $(addprefix ${Dir}/, $(addsuffix .pdf, ${Fig}))
+figPrint = $(addprefix ${Dir}/, $(addsuffix print.tex, ${Fig}))
+Tgt = ${figPdf} ${figPrint}
+
+########################################
+
+all: ${Tgt}
+
+clean:
+ ${RM} *~ ${Tgt}
+
+install:
+# do nothing
+
+########################################
+
+fig: ${figPdf}
+${figPdf}: Lo = '\def\figsrc{$(notdir $(basename $@))}'
+${figPdf}: ${Dir}/%.pdf: fig.tex %.tex #${Dir}/${Name}.sty
+ $(call MakeFigPdf,$(basename $@),fig)
+
+########################################
+
+untilComment = $(addprefix ${Dir}/, $(addsuffix print.tex, \
+ fig1Robert1 fig2base fig2sis fig3Lily1 fig4Robert))
+${untilComment}: ${Dir}/%print.tex: %.tex
+ sed -e '/^%$$/,$$d' -e 's/.hfill//' $< | grep -v '^%' > $@
+
+noIndvdl = $(addprefix ${Dir}/, $(addsuffix print.tex, \
+ fig2ival fig3Robert2))
+${noIndvdl}: ${Dir}/%print.tex: %.tex
+ fgrep -vw indvdldef $< |\
+ fgrep -vx '' |\
+ $(call MakePrintTex, -) > $@
+
+${Dir}/fig3Lily2print.tex: ${Dir}/%print.tex: %.tex
+ { \
+ echo ...; \
+ fgrep -vw indvdldef $< |\
+ sed -e '/tabular/,$$d' |\
+ $(call MakePrintTex, -); \
+ } > $@
+
+$(addprefix ${Dir}/, $(addsuffix print.tex, \
+ fig3Lily3 fig3Lily4 fig4Lily2)): ${Dir}/%print.tex: %.tex
+ { \
+ echo ...; \
+ sed -e '0,/newsavebox/d' -e '/tabular/,$$d' $< |\
+ $(call MakePrintTex, -); \
+ } > $@
+
+${Dir}/fig4Lily3print.tex: n = 4
+${Dir}/fig4Lily4print.tex: n = 2
+$(addprefix ${Dir}/, $(addsuffix print.tex, \
+ fig4Lily3 fig4Lily4)): ${Dir}/%print.tex: %.tex
+ { \
+ echo ...; \
+ tail -${n} $<; \
+ } > $@
+
+${Dir}/%print.tex: %.tex
+ $(call MakePrintTex, $<) > $@
+
+-include priv.mk
diff --git a/macros/latex/contrib/familytree/figs/fig.tex b/macros/latex/contrib/familytree/figs/fig.tex
new file mode 100644
index 0000000000..19d0fceafb
--- /dev/null
+++ b/macros/latex/contrib/familytree/figs/fig.tex
@@ -0,0 +1,9 @@
+\documentclass[]{article}
+\usepackage{familytree}
+\begin{document}
+\pagestyle{empty}
+\hfill
+\input{\figsrc}
+\hfill
+\hskip0pt
+\end{document}
diff --git a/macros/latex/contrib/familytree/figs/fig1Robert1.tex b/macros/latex/contrib/familytree/figs/fig1Robert1.tex
new file mode 100644
index 0000000000..22adc5d1ab
--- /dev/null
+++ b/macros/latex/contrib/familytree/figs/fig1Robert1.tex
@@ -0,0 +1,19 @@
+\indvdldef[\fttop]{Robert}{Robert Crawley}[\maleline]
+\fbox{\usebox{\Robert}}\hfill
+%
+\makeatletter
+\let\nameuse=\@nameuse
+\makeatother
+\newcommand{\boxsz}[1]{%
+ \texttt{\textbackslash#1} & \nameuse{#1}\\%
+}
+\newcommand{\tblA}{%
+ \begin{tabular}{l|l}%
+ \boxsz{RobertnameX}%
+ \boxsz{RobertnameCX}%
+ \boxsz{RobertnameCY}%
+ \end{tabular}%
+}
+\par
+\bigskip
+\hfill\tblA
diff --git a/macros/latex/contrib/familytree/figs/fig1Robert2.tex b/macros/latex/contrib/familytree/figs/fig1Robert2.tex
new file mode 100644
index 0000000000..ab7c617a4b
--- /dev/null
+++ b/macros/latex/contrib/familytree/figs/fig1Robert2.tex
@@ -0,0 +1,3 @@
+\indvdldef{Robert}[7th]{Robert Crawley}
+ [7th Earl of Grantham,\maleline]
+\fbox{\usebox{\Robert}}
diff --git a/macros/latex/contrib/familytree/figs/fig2base.tex b/macros/latex/contrib/familytree/figs/fig2base.tex
new file mode 100644
index 0000000000..549aa5b8cc
--- /dev/null
+++ b/macros/latex/contrib/familytree/figs/fig2base.tex
@@ -0,0 +1,13 @@
+\indvdldef{A}{one's name}[\maleline]
+\indvdldef{B}{one's loooong name}[\maleline]
+\sblngdef{ABbro}{A,B}
+%
+{
+\def\arraystretch{1.5}
+\begin{tabular}{l}
+\fbox{\usebox{\A}}\\
+\fbox{\usebox{\B}}\\
+\\
+\fbox{\usebox{\ABbro}}
+\end{tabular}
+}
diff --git a/macros/latex/contrib/familytree/figs/fig2ival.tex b/macros/latex/contrib/familytree/figs/fig2ival.tex
new file mode 100644
index 0000000000..6f820195bc
--- /dev/null
+++ b/macros/latex/contrib/familytree/figs/fig2ival.tex
@@ -0,0 +1,5 @@
+\indvdldef{youngSybil}{Lady Sybil}
+\indvdldef{youngEdith}{Lady Edith}
+\indvdldef{youngMary}{Lady Mary}
+\sblngdef{youngSis}{youngMary,ivali,youngEdith,ivalii,youngSybil}
+\fbox{\usebox{\youngSis}}
diff --git a/macros/latex/contrib/familytree/figs/fig2sis.tex b/macros/latex/contrib/familytree/figs/fig2sis.tex
new file mode 100644
index 0000000000..aab069ead5
--- /dev/null
+++ b/macros/latex/contrib/familytree/figs/fig2sis.tex
@@ -0,0 +1,25 @@
+\sblngboxcfg{1ex}
+\indvdldef{youngSybil}{Lady Sybil}
+\indvdldef{youngEdith}{Lady Edith}
+\indvdldef{youngMary}{Lady Mary}
+\sblngdef{youngSis}{youngMary,youngEdith,youngSybil}
+\fbox{\usebox{\youngSis}}
+\hfill
+%
+\makeatletter
+\let\nameuse=\@nameuse
+\makeatother
+\newcommand{\boxsz}[1]{%
+ \texttt{\textbackslash#1} & \nameuse{#1}\\%
+}
+\newcommand{\tblA}{%
+ \begin{tabular}{l|l}%
+ \boxsz{youngSisnameCY}%
+ \boxsz{youngSisyoungMarynameCY}%
+ \boxsz{youngSisyoungEdithnameCY}%
+ \boxsz{youngSisyoungSybilnameCY}%
+ \end{tabular}%
+}
+\par
+\bigskip
+\hfill\tblA
diff --git a/macros/latex/contrib/familytree/figs/fig3Lily1.tex b/macros/latex/contrib/familytree/figs/fig3Lily1.tex
new file mode 100644
index 0000000000..41dbc8dc1c
--- /dev/null
+++ b/macros/latex/contrib/familytree/figs/fig3Lily1.tex
@@ -0,0 +1,16 @@
+\indvdldef{Dudly}{Dudly}
+\indvdldef{Petunia}{Petunia}[\matrilineal]
+\pcdef{Dursleys}{Petunia}{Dudly}
+
+\indvdldef{Harry}{Harry}
+\indvdldef{Lily}{Lily}[\matrilineal]
+\pcdef{Potters}{Lily}{Harry}
+
+\sblngdef{sis}{Dursleys,Potters}
+%
+\begin{tabular}{l}
+\fbox{\usebox{\Dursleys}}\\
+\fbox{\usebox{\Potters}}\\
+\\
+\fbox{\usebox{\sis}}
+\end{tabular}
diff --git a/macros/latex/contrib/familytree/figs/fig3Lily2.tex b/macros/latex/contrib/familytree/figs/fig3Lily2.tex
new file mode 100644
index 0000000000..6172ff1c98
--- /dev/null
+++ b/macros/latex/contrib/familytree/figs/fig3Lily2.tex
@@ -0,0 +1,17 @@
+\indvdldef{Dudly}{Dudly}
+\indvdldef{Petunia}{Petunia}[\matrilineal]
+
+\indvdldef{Harry}{Harry}
+\indvdldef{Lily}{Lily}[\matrilineal]
+
+\sblngdef{sis}{Petunia,Lily}
+\gensdef{twofam}{sis}{%
+ {Petunia}{Dudly},%
+ {Lily}{Harry}%
+}
+
+\begin{tabular}{l}
+\fbox{\usebox{\sis}}\\
+\\
+\fbox{\usebox{\twofam}}
+\end{tabular}
diff --git a/macros/latex/contrib/familytree/figs/fig3Lily3.tex b/macros/latex/contrib/familytree/figs/fig3Lily3.tex
new file mode 100644
index 0000000000..fd8a134b5d
--- /dev/null
+++ b/macros/latex/contrib/familytree/figs/fig3Lily3.tex
@@ -0,0 +1,20 @@
+\indvdldef{Dudly}{Dudly}
+\indvdldef{Petunia}{Petunia}[\matrilineal]
+\pcdef{Dursleys}{Petunia}{Dudly}
+
+\indvdldef{Harry}{Harry}
+\newsavebox{\boxA}
+\newsavebox{\boxB}
+\savebox{\boxA}{\hbox{Petunia}}
+\savebox{\boxB}{\hbox{Lily}}
+\indvdldef{Lily}{Lily}[\matrilineal][\dimexpr\wd\boxA - \wd\boxB\relax]
+\pcdef{Potters}{Lily}{Harry}
+
+\sblngdef{sis}{Dursleys,Potters}
+
+\begin{tabular}{l}
+\fbox{\usebox{\Dursleys}}\\
+\fbox{\usebox{\Potters}}\\
+\\
+\fbox{\usebox{\sis}}
+\end{tabular}
diff --git a/macros/latex/contrib/familytree/figs/fig3Lily4.tex b/macros/latex/contrib/familytree/figs/fig3Lily4.tex
new file mode 100644
index 0000000000..bcf9653fe8
--- /dev/null
+++ b/macros/latex/contrib/familytree/figs/fig3Lily4.tex
@@ -0,0 +1,18 @@
+\indvdldef{Dudly}{Dudly}
+\indvdldef{Petunia}{Petunia}[\matrilineal]
+\pcdef{Dursleys}{Petunia}{Dudly}
+
+\indvdldef{Harry}{Harry}
+\newsavebox{\boxA}
+\savebox{\boxA}{\hbox{Petunia}}
+\indvdldef{Lily}{\hbox to \wd\boxA{Lily}}[\matrilineal]
+\pcdef{Potters}{Lily}{Harry}
+
+\sblngdef{sis}{Dursleys,Potters}
+
+\begin{tabular}{l}
+\fbox{\usebox{\Dursleys}}\\
+\fbox{\usebox{\Potters}}\\
+\\
+\fbox{\usebox{\sis}}
+\end{tabular}
diff --git a/macros/latex/contrib/familytree/figs/fig3Robert1.tex b/macros/latex/contrib/familytree/figs/fig3Robert1.tex
new file mode 100644
index 0000000000..977e30e71d
--- /dev/null
+++ b/macros/latex/contrib/familytree/figs/fig3Robert1.tex
@@ -0,0 +1,12 @@
+\indvdldef{youngSybil}{Lady Sybil}
+\indvdldef{youngEdith}{Lady Edith}
+\indvdldef{youngMary}{Lady Mary}
+\sblngdef{youngSis}{youngMary,youngEdith,youngSybil}
+
+\indvdldef{Robert}{Robert Crawley}
+ [7th Earl of Grantham,\maleline][2em]
+\pcdef{RobertDaughters}{Robert}{youngSis}
+
+\indvdldef{Rosamund}{Rosamund Painswick}
+\sblngdef{RobertRosamund}{RobertDaughters,Rosamund}
+\fbox{\usebox{\RobertRosamund}}
diff --git a/macros/latex/contrib/familytree/figs/fig3Robert2.tex b/macros/latex/contrib/familytree/figs/fig3Robert2.tex
new file mode 100644
index 0000000000..82dd9b6c48
--- /dev/null
+++ b/macros/latex/contrib/familytree/figs/fig3Robert2.tex
@@ -0,0 +1,13 @@
+\indvdldef{youngSybil}{Lady Sybil}
+\indvdldef{youngEdith}{Lady Edith}
+\indvdldef{youngMary}{Lady Mary}
+\sblngdef{youngSis}{youngMary,youngEdith,youngSybil}
+
+\indvdldef{Robert}{Robert Crawley}[7th Earl of Grantham,\maleline]
+\indvdldef{Rosamund}{Rosamund Painswick}
+\sblngdef{RobertRosamund}{Robert,Rosamund}
+
+\gensdef{family}{RobertRosamund}{
+ {Robert}{youngSis}
+}
+\fbox{\usebox{\family}}
diff --git a/macros/latex/contrib/familytree/figs/fig3sis.tex b/macros/latex/contrib/familytree/figs/fig3sis.tex
new file mode 100644
index 0000000000..e5b2f57dac
--- /dev/null
+++ b/macros/latex/contrib/familytree/figs/fig3sis.tex
@@ -0,0 +1,11 @@
+\sblngboxcfg{1ex}
+\indvdldef{youngSybil}{Lady Sybil}
+\indvdldef{youngEdith}{Lady Edith}
+\indvdldef{youngMary}{Lady Mary}
+\sblngdef{youngSis}{youngMary,youngEdith,youngSybil}
+%\fbox{\usebox{\youngSis}}
+
+\indvdldef{Robert}{Robert Crawley}[7th Earl of Grantham]
+
+\pcdef{family}{Robert}{RobertRosamund}
+\fbox{\usebox{\family}}
diff --git a/macros/latex/contrib/familytree/figs/fig4HenryVIII.tex b/macros/latex/contrib/familytree/figs/fig4HenryVIII.tex
new file mode 100644
index 0000000000..afdbe83eba
--- /dev/null
+++ b/macros/latex/contrib/familytree/figs/fig4HenryVIII.tex
@@ -0,0 +1,20 @@
+\indvdldef{HenryVIII}{King Henry VIII}[]
+
+\indvdldef[\ftblank]{CatherineofAragon}{Catherine of Aragon}
+ [married in 1509,\haschild]
+\indvdldef[\ftblank]{Elizabeth}{Elizabeth Blount}
+ [mistress,\haschild,\private]
+\indvdldef[\ftblank]{AnneBoleyn}{Anne Boleyn}
+ [m. 1533,\haschild]
+\indvdldef[\ftblank]{Jane}{Jane Seymour}
+ [m. 1536,\haschild]
+\indvdldef[\ftblank]{AnneofCleves}{Anne of Cleves}
+ [m. 1540]
+\indvdldef[\ftblank]{CatherineHoward}{Catherine Howard}
+ [m. 1540]
+\indvdldef[\ftblank]{CatherineParr}{Catherine Parr}
+ [m. 1543]
+
+\mrrgdef{HenryVIIIWives}{}{HenryVIII}{CatherineofAragon,Elizabeth,%
+ AnneBoleyn,Jane,AnneofCleves,CatherineHoward,CatherineParr}
+\fbox{\usebox{\HenryVIIIWives}}
diff --git a/macros/latex/contrib/familytree/figs/fig4Lily1.tex b/macros/latex/contrib/familytree/figs/fig4Lily1.tex
new file mode 100644
index 0000000000..c8a36a7b03
--- /dev/null
+++ b/macros/latex/contrib/familytree/figs/fig4Lily1.tex
@@ -0,0 +1,10 @@
+\indvdldef{Petunia}{Petunia}
+\indvdldef[\blank]{Vernon}{Vernon Dursley}[\haschild]
+\mrrgdef{Dursleys}{Vernon}{Petunia}{}
+
+\indvdldef{Lily}{Lily}
+\indvdldef[\blank]{James}{James Potter}[\haschild]
+\mrrgdef{Potters}{James}{Lily}{}
+
+\sblngdef{sis}{Dursleys,Potters}
+\fbox{\usebox{\sis}}
diff --git a/macros/latex/contrib/familytree/figs/fig4Lily2.tex b/macros/latex/contrib/familytree/figs/fig4Lily2.tex
new file mode 100644
index 0000000000..04d1167de2
--- /dev/null
+++ b/macros/latex/contrib/familytree/figs/fig4Lily2.tex
@@ -0,0 +1,12 @@
+\indvdldef{Petunia}{Petunia}
+\indvdldef[\blank]{Vernon}{Vernon Dursley}[\haschild]
+\mrrgdef{Dursleys}{Vernon}{Petunia}{}
+
+\newsavebox{\boxA}
+\savebox{\boxA}{\hbox{Petunia}}
+\indvdldef{Lily}{\hbox to \wd\boxA{Lily}}
+\indvdldef[\blank]{James}{James Potter}[\haschild]
+\mrrgdef{Potters}{James}{Lily}{}[\dimexpr\wd\Vernon - \wd\James\relax]
+
+\sblngdef{sis}{Dursleys,ivali,Potters}
+\fbox{\usebox{\sis}}
diff --git a/macros/latex/contrib/familytree/figs/fig4Lily3.tex b/macros/latex/contrib/familytree/figs/fig4Lily3.tex
new file mode 100644
index 0000000000..5abc54e43b
--- /dev/null
+++ b/macros/latex/contrib/familytree/figs/fig4Lily3.tex
@@ -0,0 +1,12 @@
+\indvdldef{Petunia}{Petunia}
+\indvdldef[\blank]{Vernon}{Vernon Dursley}[\haschild]
+\mrrgdef{Dursleys}{Vernon}{Petunia}{}
+
+\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]
+
+\sblngdef{sis}{Dursleys,Potters}
+\fbox{\usebox{\sis}}
diff --git a/macros/latex/contrib/familytree/figs/fig4Lily4.tex b/macros/latex/contrib/familytree/figs/fig4Lily4.tex
new file mode 100644
index 0000000000..c310fe8b19
--- /dev/null
+++ b/macros/latex/contrib/familytree/figs/fig4Lily4.tex
@@ -0,0 +1,12 @@
+\indvdldef{Petunia}{Petunia}
+\indvdldef[\blank]{Vernon}{Vernon Dursley}[\haschild]
+\mrrgdef{Dursleys}{Vernon}{Petunia}{}
+
+\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]
+
+\sblngdef{sis}{Dursleys,ivali,Potters}
+\fbox{\usebox{\sis}}
diff --git a/macros/latex/contrib/familytree/figs/fig4Robert.tex b/macros/latex/contrib/familytree/figs/fig4Robert.tex
new file mode 100644
index 0000000000..0ce946757b
--- /dev/null
+++ b/macros/latex/contrib/familytree/figs/fig4Robert.tex
@@ -0,0 +1,23 @@
+\indvdldef{Robert}{Robert Crawley}[7th Earl of Grantham]
+\indvdldef[\ftblank]{Cora}{Cora Crawley}
+ [Countess of Grantham,\haschild]
+\mrrgdef{seven}{}{Robert}{Cora}
+\fbox{\usebox{\seven}}
+%
+\hfill\hskip0pt
+\makeatletter
+\let\nameuse=\@nameuse
+\makeatother
+\newcommand{\boxsz}[1]{%
+ \texttt{\textbackslash#1} & \nameuse{#1}\\%
+}
+\newcommand{\tblA}{%
+ \begin{tabular}{l|l}%
+ \boxsz{sevennameCY}%
+ \boxsz{sevenRobertnameCY}%
+ \boxsz{sevenCoramrrgCY}%
+ \end{tabular}%
+}
+\par
+\bigskip
+\hfill\tblA
diff --git a/macros/latex/contrib/familytree/fonts.tex b/macros/latex/contrib/familytree/fonts.tex
new file mode 100644
index 0000000000..7b005826ae
--- /dev/null
+++ b/macros/latex/contrib/familytree/fonts.tex
@@ -0,0 +1,3 @@
+\usepackage[scaled=.95]{erewhon}
+\usepackage[erewhon,vvarbb,bigdelims]{newtxmath}
+\usepackage[scale=.95]{Chivo}
diff --git a/macros/latex/contrib/familytree/ft-gens.dtx b/macros/latex/contrib/familytree/ft-gens.dtx
new file mode 100644
index 0000000000..f179f060ec
--- /dev/null
+++ b/macros/latex/contrib/familytree/ft-gens.dtx
@@ -0,0 +1,365 @@
+% \iffalse
+% Copyright 2022 Jiro Senju
+%
+% 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/>.
+% \fi
+%
+% \newcommand{\tOne}{Parent-child Relationship Box or Generations Box}
+% \newcommand{\tTwo}{(\texttt{ft-gens.dtx})}
+% \section[\tOne{} \tTwo]{\tOne\\\tTwo}
+%
+% \DescribeMacro{\pcdef}
+% \cmd{\pcdef
+% \marg{new box name}
+% \marg{parent box name}
+% \marg{child box name}
+% }
+% \medskip
+%
+% Defines a parent-child relationship box.
+% Connects the given \meta{parent box} and \meta{child box} by a line,
+% and creates a new box \meta{new box name}.
+%
+% \meta{parent box} is a box who has only one line from an individual
+% name to one's child. For example, the box created by |\indvdldef| with
+% |\maleline| attribute (and equivalent) is specified.
+% Obviously, \meta{child box} is a box who has a line to one's parent.
+% For example, the box created by |\indvdldef| with |\biological| or
+% |\adopted| is specified as a child mark.
+%
+% |\pcdef| is a simplified version of |\gensdef|, which is discussed next.
+% \bigskip
+%
+% \noindent
+% \DescribeMacro{\gensdef}
+% \cmd{\gensdef
+% \marg{new box name}
+% \marg{parent box name}
+% \marg{list of connection-pair}
+% }
+%
+% \begin{tabbing}
+% \hspace{4em} \=\kill
+% \texttt{connection-pair :=}\\
+% \> \marg{individual box name in the parent box}\\
+% \> \marg{child box name}
+% \end{tabbing}
+% \medskip
+%
+% Defines a two-generations box.
+% Same to |\pcdef|, \meta{child box} is a box who has only one line to
+% the parent, but \meta{parent box} can have multiple lines to one's child.
+% It is \meta{connection-pair} that makes it clear which parent connects
+% to which child box.
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \subsection{Example}
+%
+% \begin{enumerate}
+% \item
+% |\sblngdef| for daughters, |\pcdef|, and then |\sblngdef| for their
+% parent generation.
+% \srcfig{fig3Robert1}
+%
+% \needspace{2\baselineskip}
+% \item
+% two |\sblngdef|, and then |\gensdef|. The result is essentially same.
+% One difference is the space between the siblings which was
+% automatically adjusted in previous example.
+% \srcfig{fig3Robert2}
+% \end{enumerate}
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \subsection{The order of connecting multiple boxes}
+% \label{sec:Lily1}
+%
+% If we get |\sblngdef| as a tool to align the individual boxes in
+% column, then |\pcdef| and |\gensdef| are the tool to align the boxes
+% in row.
+% When the siblings have their child for each, then there are multiple
+% parent-child relationships, so it is better to call it generations box
+% rather than parent-child box.
+%
+% There are two ways to draw such tree. One is to define parent-child
+% first and then define the siblings of the parent generation. The other
+% is in the reverse order, eg. to define the siblings of the parent
+% generation first and then define the parent-child relationship for each.
+%
+% Let's consider about these two ways.
+%
+% \begin{enumerate}
+% \needspace{2\baselineskip}
+% \item
+% define two parent-child relationships, and then define the siblings.
+%
+% \srcfig{fig3Lily1}
+%
+% \needspace{3\baselineskip}
+% \item
+% define the sisters, and then define the parent-child for each.
+%
+% \srcfig{fig3Lily2}
+% \end{enumerate}
+%
+% As you see, by the 1st method the length of two lines to their child
+% differs and the positions (in horizontal) of the child generation are
+% not equal. That makes the tree uneasy to understand straightforward.
+% It is because that the feature of |\sblngdef| to set the line length
+% to the longest one didn't work.
+% The argument passed to |\sblngdef| were already connected to the child,
+% so if |\sblngdef| extended the line it would be much worse result.
+%
+% On the other hand, by the 2nd method, the argument passed to
+% |\sblngdef| were not connected to the child. So it is harmless if
+% |\sblngdef| extends the line.
+% \smallskip
+%
+% Even if you took the 1st method, there still exists to make the line
+% length equal.
+% Using |\indvdldef| feature to adjust the line length, set the length
+% of Lily's |\femaleline| (|\matrilineal|) to the one of Petunia's.
+% To achieve this, calculate the difference of the name length of these
+% sisters and give an optional argument of |\indvdldef|.
+% The result should be same to above.
+% \medskip
+%
+% \srcfig{fig3Lily3}
+% \medskip
+%
+% You can get the same result if you use |\nameboxcfg| since it has a
+% feature to set the length of a line to child.
+% But it is not a good idea to use |\nameboxcfg| every time when you
+% |\indvdldef|. The value set by |\nameboxcfg| should be applied wider,
+% and it is not supposed to use for a single |\indvdldef|. It is better
+% to append an optional argument to |\indvdldef|.
+% \smallskip
+%
+% There is one more option. It is to set the length of Lily's name to Petunia's.
+% By this method, the space between Lily's name and the line to child
+% becomes wider and the length of lines become equal.
+% \medskip
+%
+% \srcfig{fig3Lily4}
+% \medskip
+%
+% The sequence or the order to define and connect the boxes is important.
+% In connecting the boxes, this package considers the size of the
+% being connected individual boxes. For example, the sibling box
+% considers the height of the
+% individual box and makes the boxes to be never overlapped.
+% But in connecting a child to the already defined sibling box, this
+% feature doesn't work. So the children of the siblings may be
+% overlapped. In this case, you need to insert the interval box between
+% the siblings manually.
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \subsectImpl
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \subsubsection{Generations box --- core}
+%
+% \iffalse
+% \parag{Customization}
+%
+% \DescribeMacro{\ftgenscfg}
+% \NoDescription
+% \begin{macrocode}
+% \newcommand{\ftgenscfg}[1]{%
+% }
+% \end{macrocode}
+% \fi
+%
+% \parag{Connection pair}
+%
+% \DescribeMacro{\ft@getpair}
+% Extracts a connection-pair from the given list,
+% defines the connection-point in the parent box (the former of the pair)
+% as |\ft@cpoint|, and defines the child box name (the latter of the
+% pair) as |\ft@kids|.
+% \smallskip
+%
+% \begin{macrocode}
+\def\ft@getpair#1#2#3{% connection-pair parent-box-name
+ \ft@dbgmsg{args #1, #2, #3}%
+ \@ifundefined{#3#1nameCY}{%
+ \@ifundefined{#3#1mrrgCY}{%
+ \xdef\ft@cpoint{#1nameCY}%
+ }{%
+ \xdef\ft@cpoint{#3#1mrrgCY}%
+ }%
+ }{%
+ \xdef\ft@cpoint{#3#1nameCY}%
+ }%
+ \xdef\ft@kids{#2}%
+}
+% \end{macrocode}
+%
+% \parag{Top margin}
+%
+% \DescribeMacro{\def@calc@xtop}
+%
+% \begin{macrocode}
+\newcommand{\ft@calc@xtop}[4]{% name parent cpoint kids
+ % top half of kids
+ \ft@len=\dimexpr\ht\@nameuse{#4} - \@nameuse{#4nameCY}pt\relax\relax%
+ % top half of parent cpoint
+ \@tempskipa=\dimexpr\ht\@nameuse{#2} - \@nameuse{#3}pt\relax\relax%
+ %
+ \ifdim\ft@len<\@tempskipa%
+ \ft@len=0pt%
+ \else%
+ \advance\ft@len -\@tempskipa%
+ \fi%
+ \global#1=\ft@len%
+}
+% \end{macrocode}
+%
+% \parag{Bottom margin}
+%
+% \DescribeMacro{\ft@calc@xbottom}
+%
+% \begin{macrocode}
+\newcommand{\ft@calc@xbottom}[4]{% name parent cpoint kids
+ % bottom half of kids
+ \ft@len=\@nameuse{#4nameCY}pt\relax%
+ % bottom half of parent cpoint
+ \@tempskipa=\@nameuse{#3}pt\relax%
+ %
+ \ifdim\ft@len=\@tempskipa%
+ \ft@len=0pt%
+ \global\setlength{\ft@depth}{\dp\@nameuse{#2}}%
+ \ifdim\ft@depth<\dp\@nameuse{#4}%
+ \global\setlength{\ft@depth}{\dp\@nameuse{#4}}%
+ \fi%
+ \else%
+ \ifdim\ft@len<\@tempskipa%
+ \ft@len=0pt%
+ \global\setlength{\ft@depth}{\dp\@nameuse{#2}}%
+ \else%
+ \advance\ft@len -\@tempskipa%
+ \global\setlength{\ft@depth}{\dp\@nameuse{#4}}%
+ \fi%
+ \fi%
+ \global#1=\ft@len%
+}
+% \end{macrocode}
+%
+% \parag{Calculate the box size}
+%
+% \DescribeMacro{\ft@gens@size}
+%
+% \begin{macrocode}
+\newlength{\ft@xtop}
+\newlength{\ft@xbottom}
+\newcommand{\ft@gens@size}[2]{% parent-box connect-pair-list
+ \@tempswatrue%
+ \ft@width=0pt%
+ \@for\@temptokena:=#2\do{%
+ \expandafter\ft@getpair\@temptokena{#1}%
+ \ft@dbgmsg{\ft@cpoint and \ft@kids}%
+ \if@tempswa%
+ \ft@calc@xtop{\ft@xtop}{#1}{\ft@cpoint}{\ft@kids}%
+ \@tempswafalse%
+ \fi%
+ \setlength{\ft@len}{\wd\@nameuse{\ft@kids}}%
+ \ifdim\ft@width<\ft@len%
+ \global\ft@width=\ft@len%
+ \fi%
+ }%
+ \ft@calc@xbottom{\ft@xbottom}{#1}{\ft@cpoint}{\ft@kids}%
+ \ft@dbgmsg{xtop \the\ft@xtop, xbottom \the\ft@xbottom}%
+ %
+ \ft@x=\dimexpr\wd\@nameuse{#1}% - \ft@cmarkbox@length\relax%
+ \ft@dbgmsg{x \the\ft@x}%
+ \advance\ft@width \ft@x%
+ \ft@dbgmsg{w \the\ft@width}%
+ \ft@height=\dimexpr\ht\@nameuse{#1} + \ft@xtop + \ft@xbottom\relax%
+ \ft@dbgmsg{kids H \the\ht\@nameuse{\ft@kids}}%
+ \ft@dbgmsg{H \strip@pt\ft@height, D \strip@pt\ft@depth}%
+}
+% \end{macrocode}
+%
+% \parag{Layout}
+%
+% \DescribeMacro{\ft@gens@layout}
+%
+% \begin{macrocode}
+\newcommand{\ft@gens@layout}[3]{%
+ % box-name parent-box-name {{parent-name} {child-name}, ...}
+ \ft@newnamebox{#1}{%
+ \edef\@w{\strip@pt\ft@width}%
+ \edef\@h{\strip@pt\ft@height}%
+ \begin{picture}(\@w,\@h)%
+ \ft@dbgframe{\@w,\@h}%
+ %
+ \ft@y=\ft@xbottom%
+ \ft@dbgplot{0,\strip@pt\ft@y}%
+ \put(0,\strip@pt\ft@y){\usebox{\@nameuse{#2}}}%
+ \advance\ft@y \@nameuse{#2nameCY}pt%
+ \ft@namexdefstrip{#1nameCY}{\ft@y}%
+ %\ft@namexdefstrip{#1#2nameCY}{\ft@y}%
+ %
+ \@for\@temptokena:=#3\do{%%
+ \expandafter\ft@getpair\@temptokena{#2}%
+ \ft@dbgmsg{\ft@cpoint and \ft@kids}%
+ %
+ \ft@y=\dimexpr\ft@xbottom + \@nameuse{\ft@cpoint}pt\relax%
+ \ft@dbgmsg{parent cpoint \the\ft@y}%
+ \ft@dbgplot{\strip@pt\ft@x,\strip@pt\ft@y}%
+ %
+ \advance\ft@y -\@nameuse{\ft@kids nameCY}pt%
+ \ft@dbgmsg{final child y \the\ft@y}%
+ \put(\strip@pt\ft@x,\strip@pt\ft@y){%
+ \usebox{\@nameuse{\ft@kids}}}%
+ \ft@namexdefstrip{#1\ft@kids Y}{\ft@y}%
+ }%
+ \end{picture}%
+ }%
+}
+% \end{macrocode}
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \subsubsection{Generations box --- interface}
+%
+% \DescribeMacro{\ftgensdef}
+%
+% \begin{macrocode}
+\newcommand{\ftgensdef}[3]{%
+ % box-name parent-box-name {{parent-name} {child-name}, ...}
+ %
+ % calculate the size of the new box
+ \ft@gens@size{#2}{#3}%
+ %
+ % draw them all
+ \ft@gens@layout{#1}{#2}{#3}%
+ %
+ \@ifundefined{#2hascmark}{}{%
+ \ft@namexdef{#1hascmark}{\@nameuse{#2hascmark}}%
+ }%
+ \ft@nameboxsz{#1}{\ft@height}{\ft@depth}%
+}
+\ft@alias{gensdef}
+% \end{macrocode}
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \subsubsection{Parent-child box --- interface}
+%
+% \DescribeMacro{\ftpcdef}
+%
+% \begin{macrocode}
+\newcommand{\ftpcdef}[3]{% box-name parent-box-name child-box-name
+ \ftgensdef{#1}{#2}{{#2}{#3}}%
+}
+\ft@alias{pcdef}
+% \end{macrocode}
diff --git a/macros/latex/contrib/familytree/ft-individual.dtx b/macros/latex/contrib/familytree/ft-individual.dtx
new file mode 100644
index 0000000000..a8b0e4eacf
--- /dev/null
+++ b/macros/latex/contrib/familytree/ft-individual.dtx
@@ -0,0 +1,760 @@
+% \iffalse
+% Copyright 2022 Jiro Senju
+%
+% 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/>.
+% \fi
+%
+% \section{Individual Box (\texttt{ft-individual.dtx})}
+%
+% \DescribeMacro{\indvdldef}
+% \indent
+% \cmd{\indvdldef
+% \oarg{child mark}
+% \marg{new box name}
+% \oarg{title}
+% \marg{individual name}
+% \oarg{additional info}
+% \oarg{maleline xlength}
+% }
+% \medskip
+%
+% Defines a new box named \meta{new box name}, and layouts the
+% given arguments in that box.
+%
+% \begin{enumerate}
+% \item \oarg{child mark}
+% \par
+% The type of a line which is located ahead of the individual name.
+% \par
+% Specify one of |\ftbiological|,
+% |\ftadopted|,
+% |\fttop|,
+% or |\ftblank|.
+% Details are discussed later.
+%
+% \item \marg{new box name}
+% \par
+% The name of a new box.
+% \par
+% This is not a \CS{} (no backslash).
+%
+% \item \oarg{title}
+% \par
+% One's title.
+% \par
+% Put at the shoulder of the individual name with a smaller font
+% (|\relsize{-2}|).
+%
+% \item \marg{individual name}
+% \par
+% One's name.
+%
+% \item \oarg{additional info}
+% \par
+% Additional information.
+% \par
+% Anything can be added such as birth\slash death year-month-date and alias.
+% Put with a little smaller font (|\relsize{-1}|) at next to the individual name.
+% Also the attributes (discussed later),
+% |\ftmaleline| (|\ftfemaleline|, |\ftpatrilineal|, |\ftmatrilineal|),
+% \allowbreak|\fthaschild|,
+% |\ftprivate| are specified here.
+%
+% \item \oarg{maleline xlength}
+% \par
+% When you draw a line from an individual (instead of a marriage box) to
+% a child, the length of the line can be adjusted by this argument.
+% But in the sibling box, the line length will be adjusted automatically
+% regardless this argument.
+% \end{enumerate}
+%
+% Also |\indvdldef| defines some connection points as \CS. The origin is
+% left-bottom of the box and the unit is |pt|.
+%
+% \begin{table}
+% \hfil\begin{tabular}{ll}
+% \meta{box name}|nameX| &
+% the tail of the individual name
+% \\
+%
+% \meta{box name}|nameCX| &
+% the center of the width of individual name
+% \\
+%
+% \meta{box name}|nameCY| &
+% the center of the height of individual name
+% \end{tabular}
+% \end{table}
+%
+% For \oarg{child mark}, you can specify one of these values.
+%
+% \begin{itemize}
+% \item |\biological| or |\ftbiological|
+% \par
+% a single line to represent a biological\slash real child.
+%
+% \item |\adopted| or |\ftadopted|
+% \par
+% a double line to represent an adopted child.
+%
+% \item |\fttop| (or |\top|)
+% \par
+% no line at all.
+%
+% \item |\blank| or |\ftblank|
+% \par
+% put a space whose size is equal to the |\biological| or |\adopted| mark,
+% assuming used for the spouse in a marriage box.
+% \end{itemize}
+% \bigskip
+%
+% For \oarg{additional info}, you can specify any of these attributes.
+%
+% \begin{itemize}
+% \item |\haschild| or |\fthaschild|
+% \par
+% represents a spouse who has a child.
+% draws a line in a marriage box to their child from the center of the
+% double line which represents a marriage.
+%
+% \item |\private| or |\ftprivate|
+% \par
+% represents the marriage is not official.
+% draws a dashed double line.
+%
+% \item |\maleline| or |\ftmaleline|
+% \par
+% draws a line to a child from the individual name instead of the double
+% line in the marriage box.
+% |\ftfemaleline|,
+% |\ftpatrilineal|,
+% |\ftmatrilineal| are all equivalent.
+% \end{itemize}
+% \bigskip
+%
+% The individual box consists of a few smaller boxes.
+%
+% \begin{itemize}
+% \item |\ft@titlebox|
+% \item |\ft@namebox|
+% \par
+% In |\ft@namebox|, there are |\ft@cmarkbox| which represents the
+% \meta{child mark}
+% and |\ft@malelinebox| which represents \meta{maleline}.
+%
+% \item |\ft@optbox|
+% \end{itemize}
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \subsection{Customization}
+%
+% \DescribeMacro{\nameboxcfg}
+% \indent
+% \cmd{\nameboxcfg
+% \marg{space from the child mark}
+% \marg{font}
+% \marg{space to the maleline}
+% \marg{maleline length}
+% }
+% \medskip
+%
+% \DescribeMacro{\cmarkboxcfg}
+% \cmd{\cmarkboxcfg
+% \marg{space between two lines, for adopted}
+% \marg{line length}
+% }
+% \medskip
+%
+% \DescribeMacro{\titleboxcfg}
+% \cmd{\titleboxcfg
+% \marg{indent}
+% \marg{font}
+% \marg{linestretch}
+% \marg{vspace to the individual name}
+% }
+% \medskip
+%
+% \DescribeMacro{\optboxcfg}
+% \cmd{\optboxcfg
+% \marg{vspace from the individual name}
+% \marg{indent}
+% \marg{font}
+% \marg{linestretch}
+% }
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \needspace{12ex}
+% \subsection{Example}
+%
+% \begin{enumerate}
+% \item
+% \srcfig{fig1Robert1}
+%
+% \item
+% \srcfig{fig1Robert2}
+% \end{enumerate}
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \subsectImpl
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \subsubsection{Child-mark box}
+%
+% \parag{Customization}
+%
+% \DescribeMacro{\ftcmarkboxcfg}
+% \DescribeMacro{\cmarkboxcfg}
+%
+% \begin{macrocode}
+\newlength{\ft@cmarkbox@adopted@sep}
+\setlength{\ft@cmarkbox@adopted@sep}{4pt}
+\newlength{\ft@cmarkbox@length}
+\setlength{\ft@cmarkbox@length}{1\ft@unit}
+\newcommand{\ftcmarkboxcfg}[2]{% adopted-sep line-length
+ \ifx#1\empty\else%
+ \setlength{\ft@cmarkbox@adopted@sep}{#1}%
+ \fi%
+ \ifx#2\empty\else%
+ \setlength{\ft@cmarkbox@length}{#2}%
+ \fi%
+}
+\ft@alias{cmarkboxcfg}
+% \end{macrocode}
+%
+% \parag{Define a box}
+%
+% \DescribeMacro{\fttop}
+% \DescribeMacro{\top}
+% \DescribeMacro{\ftbiological}
+% \DescribeMacro{\biological}
+% \DescribeMacro{\ftadopted}
+% \DescribeMacro{\adopted}
+% \DescribeMacro{\ftblank}
+% \DescribeMacro{\blank}
+%
+% \begin{macrocode}
+\chardef\fttop=0
+\chardef\ftbiological=1
+\chardef\ftadopted=2
+\chardef\ftblank=3
+\ft@alias{top}
+\ft@alias{biological}
+\ft@alias{adopted}
+\ft@alias{blank}
+% \end{macrocode}
+%
+% \DescribeMacro{\ft@indvdl@nameH}
+% \DescribeMacro{\ft@indvdl@nameD}
+% \DescribeMacro{\ft@indvdl@nameCY}
+% \DescribeMacro{\ft@do@cmarkdef}
+% \DescribeMacro{\ft@cmarkdef}
+%
+% \begin{macrocode}
+\newsavebox{\ft@cmarkbox}
+\newlength{\ft@cmarkW}
+\newlength{\ft@indvdl@nameH}
+\newlength{\ft@indvdl@nameD}
+\newlength{\ft@indvdl@nameCY}
+\newcommand{\ft@do@cmarkdef}[4]{% cmarkbox-name cmark width line-length
+ \ft@savenamebox{#1}{%
+ \edef\@w{\strip@pt#3}%
+ \edef\@h{\strip@pt\ft@indvdl@nameH}%
+ \edef\@l{\strip@pt#4}%
+ \begin{picture}(\@w,\@h)%
+ \ft@dbgframe{\@w,\@h}%
+ \ifcase#2% fttop
+ \or% ftbiological
+ \put(0,\strip@pt\ft@indvdl@nameCY){\line(1,0){\@l}}%
+ \or% ftadopted
+ \ft@y=\dimexpr\ft@indvdl@nameCY%
+ + .5\ft@cmarkbox@adopted@sep\relax%
+ \put(0,\strip@pt\ft@y){\line(1,0){\@l}}%
+ \advance\ft@y -\ft@cmarkbox@adopted@sep%
+ \put(0,\strip@pt\ft@y){\line(1,0){\@l}}%
+ \or% \ftblank
+ \fi%
+ \end{picture}%
+ }%
+ \ft@nameboxsz{#1}{\ft@indvdl@nameH}{\ft@indvdl@nameD}%
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\newcommand{\ft@cmarkdef}[4]{%
+ % cmarkbox-name cmark cmark-xlength cmark-space
+ \ft@savenamebox{#1}{}% empty
+ \ifcase#2% fttop
+ \else%
+ \ft@len=\dimexpr\ft@cmarkbox@length + #3\relax\relax%
+ \ifdim\ft@len>0pt%
+ \ft@do@cmarkdef{#1}{#2}{\dimexpr\ft@len + #4\relax}{\ft@len}%
+ \fi%
+ \fi%
+ \ft@dbgbox{\@nameuse{#1}}%
+}
+% \end{macrocode}
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \needspace{3\baselineskip}
+% \subsubsection{Additional info box}
+% \nopagebreak
+%
+% \parag{Customization}
+%
+% \DescribeMacro{\ftoptboxcfg}
+% \DescribeMacro{\optboxcfg}
+%
+% \begin{macrocode}
+\newlength{\ft@optbox@vsp}
+\setlength{\ft@optbox@vsp}{.1\baselineskip}
+\newlength{\ft@optbox@indent}
+\setlength{\ft@optbox@indent}{1.1\ft@unit}
+\newcommand{\ft@optbox@font}{\relsize{-1}}%{\footnotesize}
+\newcommand{\ft@optbox@linestretch}{.75}
+\newcommand{\ftoptboxcfg}[4]{% vsp indent font linestretch
+ \ifx#1\empty\else%
+ \setlength{\ft@optbox@vsp}{#1}%
+ \fi%
+ \ifx#2\empty\else%
+ \setlength{\ft@optbox@indent}{#2}%
+ \fi%
+ \ifx#3\empty\else%
+ \renewcommand{\ft@optbox@font}{#3}%
+ \fi%
+ \ifx#4\empty\else%
+ \renewcommand{\ft@optbox@linestretch}{#4}%
+ \fi%
+}
+\ft@alias{optboxcfg}
+% \end{macrocode}
+%
+% \parag{Parsing}
+%
+% \DescribeMacro{\ftmaleline}
+% \DescribeMacro{\maleline}
+% \DescribeMacro{\fthaschild}
+% \DescribeMacro{\haschild}
+% \DescribeMacro{\ftprivate}
+% \DescribeMacro{\private}
+%
+% \begin{macrocode}
+\newcommand{\ftmaleline}{ft@attr0}
+\let\ftfemaleline=\ftmaleline
+\let\ftpatrilineal=\ftmaleline
+\let\ftmatrilineal=\ftmaleline
+\newcommand{\fthaschild}{ft@attr1}
+\newcommand{\ftprivate}{ft@attr2}
+\ft@alias{maleline}
+\ft@alias{femaleline}
+\ft@alias{patrilineal}
+\ft@alias{matrilineal}
+\ft@alias{haschild}
+\ft@alias{private}
+% \end{macrocode}
+%
+% \DescribeMacro{\ft@optlist}
+%
+% Extracts the attributes from \meta{option-list} (which is
+% \meta{additional info} itself) and sets a global flag whose name is
+% generated using \meta{box-name}.
+% Other than the attributes are appended another list, \meta{list} which
+% will be printed later.
+%
+% \begin{macrocode}
+\newcommand{\ft@optlist}[3]{% list box-name option-list
+ \edef\@male{\ftmaleline}%
+ \edef\@hasch{\fthaschild}%
+ \edef\@priv{\ftprivate}%
+ \@for\@temptokena:=#3\do{%
+ \edef\@opt{\@temptokena}%
+ \ft@dbgmsg{\@opt}%
+ \ifx\@opt\@male%
+ \global\ft@malelinetrue%
+ \ft@namexdef{#2hasmaleline}{\ftmaleline}%
+ \else%
+ \ifx\@opt\@hasch%
+ \ft@namexdef{#2haschild}{\fthaschild}%
+ \else%
+ \ifx\@opt\@priv%
+ \ft@namexdef{#2private}{\ftprivate}%
+ \else%
+ \ft@list@append{#1}{\@opt}%
+ \fi%
+ \fi%
+ \fi%
+ }%
+}
+% \end{macrocode}
+%
+% \parag{Define a box}
+%
+% \DescribeMacro{\ft@opt}
+%
+% \begin{macrocode}
+\newsavebox{\ft@optbox}
+\newcommand{\ft@opt}[1]{% option-list
+ \savebox{\ft@optbox}{%
+ \hspace{\ft@cmarkW}%
+ \hspace{\ft@optbox@indent}%
+ \vbox{%
+ \def\baselinestretch{\ft@optbox@linestretch}%
+ \ft@optbox@font%
+ \vspace{\ft@optbox@vsp}%
+ \@for\@temptokena:=#1\do{%
+ \vss%
+ \hbox{\@temptokena}%
+ \setbox\@tempboxa=\hbox{\@temptokena}%
+ \global\ft@depth=\dp\@tempboxa%
+ }%
+ }%
+ }%
+ \ft@len=\dimexpr\ht\ft@optbox + \dp\ft@optbox - \ft@depth\relax%
+ \ft@boxsz{\ft@optbox}{\ft@len}{\ft@depth}%
+ \ft@dbgbox{\ft@optbox}%
+}
+% \end{macrocode}
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \subsubsection{Name box}
+%
+% \parag{Customization}
+%
+% \DescribeMacro{\ftnameboxcfg}
+% \DescribeMacro{\nameboxcfg}
+%
+% \begin{macrocode}
+\newlength{\ft@namebox@sp}
+\setlength{\ft@namebox@sp}{.25\ft@unit}
+\newcommand{\ft@namebox@font}{}% empty
+\newlength{\ft@namebox@maleline@sp}
+\setlength{\ft@namebox@maleline@sp}{.25\ft@unit}
+\newlength{\ft@namebox@maleline@length}
+\setlength{\ft@namebox@maleline@length}{1.5\ft@unit}
+\newcommand{\ftnameboxcfg}[4]{% sp font maleline-sp maleline-length
+ \ifx#1\empty\else%
+ \setlength{\ft@namebox@sp}{#1}%
+ \fi%
+ \ifx#2\empty\else%
+ \renewcommand{\ft@namebox@font}{#2}%
+ \fi%
+ \ifx#3\empty\else%
+ \setlength{\ft@namebox@maleline@sp}{#3}%
+ \fi%
+ \ifx#4\empty\else%
+ \setlength{\ft@namebox@maleline@length}{#4}%
+ \fi%
+}
+\ft@alias{nameboxcfg}
+% \end{macrocode}
+%
+% \parag{Define a box}
+%
+% \DescribeMacro{\ft@name}
+%
+% Internally layouts |\ft@cmarkbox|, \meta{individual-name}, and
+% |\ft@malelinebox|.
+% It was difficult to set the length of |maleline|, ie. where to begin the
+% line. Which is better for the head of |maleline|, at the box end of the
+% \meta{individual-name} or at the box end including all the
+% \meta{title}, \meta{individual-name} and \meta{additional info}?
+%
+% The latter looks good, especially when the defined individual box is
+% used alone. But it makes hard for other box definitions to calculate the
+% extra line length to align equal.
+% For such calculation, the former is better since it just has to calculate
+% the difference of the length of names.
+% Finally, I decided to start the line at the end of
+% \meta{individual-name}, and the default length is
+% |\ft@namebox@maleline@length|.
+%
+% In other words, it can happen when an individual box is used alone, the
+% \meta{title} or the \meta{additional info} may be longer than |maleline|.
+%
+% \begin{macrocode}
+\newif\ifft@maleline
+\newsavebox{\ft@malelinebox}
+\newsavebox{\ft@namebox}
+\newcommand{\ft@name}[3]{% box-name individual-name maleline-xlength
+ \setbox\@tempboxa=\hbox{\ft@namebox@font#2}%
+ \ft@len=\dimexpr\wd\@tempboxa + \ft@cmarkW%
+ + \ft@namebox@maleline@sp\relax%
+ \ft@namexdefstrip{#1nameX}{\ft@len}%
+ %
+ \ft@len=\dimexpr\wd\@tempboxa/2 + \ft@cmarkW\relax%
+ \ft@namexdefstrip{#1nameCX}{\ft@len}%
+ %
+ \def\@nm{\ft@namebox@font#2}%
+ \ifft@maleline%
+ % why are two 'relax'es necessary?
+ \@tempskipb=\dimexpr\ft@namebox@maleline@length%
+ - \ft@cmarkbox@length + #3\relax\relax%
+ \ifdim\@tempskipb>0pt%
+ \ft@cmarkdef{ft@malelinebox}{\ftbiological}{\@tempskipb}{0pt}%
+ \def\@nm{%
+ {\ft@namebox@font#2}%
+ \hspace{\ft@namebox@maleline@sp}%
+ \usebox{\ft@malelinebox}%
+ }%
+ \fi%
+ \fi%
+ \ft@dbgmsg{H \the\ht\@tempboxa, D \the\dp\@tempboxa}%
+ \ft@dbgmsg{H \the\ht\ft@cmarkbox, D \the\dp\ft@cmarkbox}%
+ \savebox{\ft@namebox}{%
+ \usebox{\ft@cmarkbox}%
+ \@nm%
+ }%
+ \ft@boxsz{\ft@namebox}{\ht\@tempboxa}{\dp\@tempboxa}%
+ \ft@dbgbox{\ft@namebox}%
+}
+% \end{macrocode}
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \needspace{2\baselineskip}
+% \subsubsection{Title box}
+%
+% \parag{Customization}
+%
+% \hyphenation{line-stretch}
+% \DescribeMacro{\fttitleboxcfg}
+% \DescribeMacro{\titleboxcfg}
+%
+% \begin{macrocode}
+\newlength{\ft@titlebox@indent}
+\setlength{\ft@titlebox@indent}{-.25\ft@unit}
+\newcommand{\ft@titlebox@font}{\relsize{-2}}%{\scriptsize}
+\newcommand{\ft@titlebox@linestretch}{.25}
+\newlength{\ft@titlebox@vsp}
+\setlength{\ft@titlebox@vsp}{.1\baselineskip}
+\newcommand{\fttitleboxcfg}[4]{% indent font linestretch vsp
+ \ifx#1\empty\else%
+ \setlength{\ft@titlebox@indent}{#1}%
+ \fi%
+ \ifx#2\empty\else%
+ \renewcommand{\ft@titlebox@font}{#2}%
+ \fi%
+ \ifx#3\empty\else%
+ \renewcommand{\ft@titlebox@linestretch}{#3}%
+ \fi%
+ \ifx#4\empty\else%
+ \setlength{\ft@titlebox@vsp}{#4}%
+ \fi%
+}
+\ft@alias{titleboxcfg}
+% \end{macrocode}
+%
+% \parag{Define a box}
+%
+% \DescribeMacro{\ft@title}
+%
+% \begin{macrocode}
+\newsavebox{\ft@titlebox}
+\newcommand{\ft@title}[1]{% title
+ \ft@len=\dimexpr\ft@cmarkW + \ft@titlebox@indent\relax%
+ \savebox{\ft@titlebox}{%
+ \vbox{%
+ \def\baselinestretch{\ft@titlebox@linestretch}%
+ \ft@titlebox@font%
+ %
+ \setbox\@tempboxa=\hbox{#1}%
+ \ft@dbgmsg{H \the\ht\@tempboxa, D \the\dp\@tempboxa}%
+ \global\ft@depth=\dp\@tempboxa%
+ \hbox{\hspace{\ft@len}#1}%
+ \vspace{\ft@titlebox@vsp}%
+ \global\advance\ft@depth \ft@titlebox@vsp%
+ }%
+ }%
+ \ft@dbgmsg{H \the\ht\ft@titlebox, D \the\dp\ft@titlebox}%
+ \ft@len=\dimexpr\ht\ft@titlebox + \dp\ft@titlebox - \ft@depth\relax%
+ \ft@boxsz{\ft@titlebox}{\ft@len}{\ft@depth}%
+ \ft@dbgbox{\ft@titlebox}%
+}
+% \end{macrocode}
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \subsubsection{Combine the boxes --- core}
+%
+% \parag{Generate the boxes}
+%
+% \DescribeMacro{\ft@indvdlbox@gen}
+% \NoDescription
+% \begin{macrocode}
+\newcommand{\ft@indvdlbox@gen}[4]{%
+ % box-name title individual-name maleline-xlength
+ \ft@width=0pt%
+ \IfValueT{#2}{%
+ \ft@title{#2}%
+ \ft@width=\wd\ft@titlebox%
+ }%
+ \global\@tempswafalse%
+ \ifx\ft@indvdl@opts\empty\else%
+ \global\@tempswatrue%
+ \ft@opt{\ft@indvdl@opts}%
+ \ifdim\ft@width<\wd\ft@optbox%
+ \ft@width=\wd\ft@optbox%
+ \fi%
+ \fi%
+ \ft@name{#1}{#3}{#4}%
+}
+% \end{macrocode}
+%
+% \parag{Calculate the size of a name box}
+%
+% \DescribeMacro{\ft@indvdlbox@calc}
+% \NoDescription
+% \begin{macrocode}
+\newcommand{\ft@indvdlbox@calc}[2]{% box-name title
+ \global\ft@width=0pt%
+ \global\ft@height=0pt%
+ \global\ft@depth=0pt%
+ \def\ft@dpri##1{\ft@dbgmsg{##1 W \the\ft@width, H \the\ft@height,%
+ D \the\ft@depth}}%
+ \ft@dpri{h0}%
+ \IfValueT{#2}{%
+ \global\ft@width=\wd\ft@titlebox%
+ \global\ft@height=\dimexpr\ht\ft@titlebox + \dp\ft@titlebox\relax%
+ \ft@dpri{h1}%
+ }%
+ %
+ \global\advance\ft@height \ht\ft@namebox%
+ %
+ % mark this point of the height, to invert it later
+ \ft@y=\dimexpr\ft@height - \ft@indvdl@nameCY\relax%
+ %
+ \ifdim\ft@width<\wd\ft@namebox%
+ \global\ft@width=\wd\ft@namebox%
+ \fi%
+ \if@tempswa%
+ \global\advance\ft@height \dp\ft@namebox%
+ \else%
+ \global\ft@depth=\dp\ft@namebox%
+ \fi%
+ \ft@dpri{h2}%
+ %
+ \if@tempswa%
+ \ifdim\ft@width<\wd\ft@optbox%
+ \global\ft@width=\wd\ft@optbox%
+ \fi%
+ \global\advance\ft@height \ht\ft@optbox%
+ \global\ft@depth=\dp\ft@optbox%
+ \ft@dpri{h3}%
+ \fi%
+ \ft@dpri{h4}%
+ %
+ % invert the y
+ \ft@len=\dimexpr\ft@height - \ft@y\relax%
+ \ft@namexdefstrip{#1nameCY}{\ft@len}%
+}
+% \end{macrocode}
+%
+% \parag{Layout them by \texttt{picture}}
+%
+% \DescribeMacro{\ft@indvdlbox@layout}
+% \NoDescription
+% \begin{macrocode}
+\newcommand{\ft@indvdlbox@layout}[2]{% box-name title
+ \ft@newnamebox{#1}{%
+ \edef\@w{\strip@pt\ft@width}%
+ \edef\@h{\strip@pt\ft@height}%
+ \begin{picture}(\@w,\@h)%
+ \ft@dbgframe{\@w,\@h}%
+ \ft@dbgplot{0,\@nameuse{#1nameCY}}%
+ %
+ \IfValueT{#2}{%
+ \advance\ft@height -\dimexpr\ht\ft@titlebox%
+ + \dp\ft@titlebox\relax%
+ \put(0,\strip@pt\ft@height){\usebox{\ft@titlebox}}%
+ }%
+ \advance\ft@height -\ht\ft@namebox%
+ \put(0,\strip@pt\ft@height){\usebox{\ft@namebox}}%
+ \advance\ft@height -\dp\ft@namebox%
+ \if@tempswa%
+ \advance\ft@height -\ht\ft@optbox%
+ \put(0,\strip@pt\ft@height){\usebox{\ft@optbox}}%
+ \fi%
+ \end{picture}%
+ }%
+ % height should hold the original value
+ \ft@nameboxsz{#1}{\ft@height}{\ft@depth}%
+}
+% \end{macrocode}
+%
+% \parag{Main function to combine the boxes}
+%
+% \DescribeMacro{\ft@indvdlbox}
+% \NoDescription
+% \begin{macrocode}
+\newcommand{\ft@indvdlbox}[4]{%
+ % box-name title individual-name maleline-xlength
+ \ft@indvdlbox@gen{#1}{#2}{#3}{#4}%
+ \ft@indvdlbox@calc{#1}{#2}%
+ \ft@indvdlbox@layout{#1}{#2}%
+ %
+ \ft@dbgbox[\ft@dbgplot{0,\@nameuse{#1nameCY}}%
+ \ft@dbgplot{\@nameuse{#1nameCX},\strip@pt\ft@height}%
+ \ft@dbgplot{\@nameuse{#1nameX},\strip@pt\ft@height}%
+ ]{\@nameuse{#1}}%
+}
+% \end{macrocode}
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \subsubsection{Individual box --- interface}
+%
+% \DescribeMacro{\ftindvdldef}
+% \DescribeMacro{\indvdldef}
+%
+% \begin{macrocode}
+% [child-mark] box-name [title] individual-name
+% [option-list...] [maleline-xlength]
+\NewDocumentCommand{\ftindvdldef}{O{\ftbiological}momoO{0pt}}{%
+ \setbox\@tempboxa=\hbox{\ft@namebox@font#4}%
+ \global\ft@indvdl@nameH=\ht\@tempboxa%
+ \global\ft@indvdl@nameD=\dp\@tempboxa%
+ \if@tate%
+ \global\ft@indvdl@nameCY%
+ =\dimexpr(\ft@indvdl@nameH - \ft@indvdl@nameD)/2\relax%
+ \else%
+ \@ifundefined{jlreqsetup}{%
+ % not jlreq
+ \global\ft@indvdl@nameCY=\dimexpr(\ft@indvdl@nameH%
+ - \ft@indvdl@nameD) / 2\relax\relax%
+ }{%
+ % jlreq
+ % magic number! depends on font?
+ \global\ft@indvdl@nameCY=\dimexpr\ft@indvdl@nameH/2 - .66pt\relax%
+ }%
+ \fi%
+ \ft@dbgmsg{H \the\ft@indvdl@nameH, D \the\ft@indvdl@nameD,%
+ CY \the\ft@indvdl@nameCY}%
+ %
+ \ft@cmarkdef{ft@cmarkbox}{#1}{0pt}{\ft@namebox@sp}%
+ \ifcase#1% fttop
+ \ft@namexdef{#2hascmark}{#1}%
+ \or% ftbiological
+ \ft@namexdef{#2hascmark}{#1}%
+ \or% ftadopted
+ \ft@namexdef{#2hascmark}{#1}%
+ \fi%
+ \global\ft@cmarkW=\wd\ft@cmarkbox%
+ %
+ \global\ft@malelinefalse%
+ \xdef\ft@indvdl@opts{}%
+ \IfValueT{#5}{%
+ \ft@optlist{\ft@indvdl@opts}{#2}{#5}%
+ \ft@dbgmsg{opt \ft@indvdl@opts}%
+ }%
+ %
+ \ft@indvdlbox{#2}{#3}{#4}{#6}%
+}
+\ft@alias{indvdldef}
+% \end{macrocode}
diff --git a/macros/latex/contrib/familytree/ft-lib.dtx b/macros/latex/contrib/familytree/ft-lib.dtx
new file mode 100644
index 0000000000..2c54589f36
--- /dev/null
+++ b/macros/latex/contrib/familytree/ft-lib.dtx
@@ -0,0 +1,247 @@
+% \iffalse
+% Copyright 2022 Jiro Senju
+%
+% 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/>.
+% \fi
+%
+% \section{Library (\texttt{ft-lib.dtx})}
+%
+% While this is the last section of this document, |ft-lib.dtx| is located
+% top of |sty|.
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \subsectImpl
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% \begin{macrocode}
+\RequirePackage{relsize}
+\RequirePackage{xparse}
+% \end{macrocode}
+%
+% \DescribeMacro{\ft@unit}
+% Represents a width of a single character.
+%
+% \DescribeMacro{\if@tate}
+% Supports Japanese vertical mode (|jlreq.cls|). Other than Japanese, this
+% dummy |\if@tate| is always false.
+% \medskip
+%
+% \begin{macrocode}
+\global\newlength{\ft@unit}%
+\@ifundefined{if@tate}{%
+ \global\newif\if@tate%
+ \global\ft@unit=1em%
+}{
+ \global\ft@unit=1zw%
+}%
+% \end{macrocode}
+%
+% \DescribeMacro{\ft@alias}
+% Makes an alias with prefix-less (|ft|).
+% I don't know why such many |\expandafter|s are necessary.
+% \medskip
+%
+% \begin{macrocode}
+\newcommand{\ft@alias}[1]{% ft-less-name
+ \@ifundefined{#1}{%
+ \global\expandafter\expandafter\expandafter%
+ \let\expandafter\expandafter\csname#1\endcsname\expandafter%
+ =\csname ft#1\endcsname%
+ }{%
+ \message{skip alias to ft#1}%
+ }%
+}
+% \end{macrocode}
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \subsubsection{utility}
+%
+% \DescribeMacro{\ftymd}
+% \DescribeMacro{\ymd}
+% \cmd{\ftymd
+% \marg{year}
+% \oarg{month}
+% \oarg{date}
+% }
+%
+% Arranges and prints year-month-date. Japanese vertical mode is supported.
+% Assumes to be used in \meta{additional info} of |\indvdldef|.
+% \medskip
+%
+% \begin{macrocode}
+\NewDocumentCommand{\ftymd}{moo}{% year [month] [date]
+ \if@tate%
+ \tatechuyoko{#1}%
+ \IfValueT{#2}{\tatechuyoko{#2}}%
+ \IfValueT{#3}{\tatechuyoko{#3}}%
+ \else%
+ #1%
+ \IfValueT{#2}{\slash#2}%
+ \IfValueT{#3}{\slash#3}%
+ \fi%
+}
+\ft@alias{ymd}
+% \end{macrocode}
+%
+% \noindent
+% \DescribeMacro{\ftundef}
+% \cmd{\ftundef
+% \marg{box name}
+% }
+%
+% Undefines all internal \CS es who has \meta{box name} in its name.
+% For this macro, we don't define the prefix-less alias.
+% \medskip
+%
+% \begin{macrocode}
+\newcommand{\ftundef}[1]{%
+ \@for\@temptokena:=#1\do{%
+ \global\expandafter\let\csname\@temptokena\endcsname=\relax%
+ \global\expandafter\let\csname\@temptokena nameCY\endcsname=\relax%
+ \global\expandafter\let\csname\@temptokena mrrgCY\endcsname=\relax%
+ \global\expandafter\let\csname\@temptokena hasmaleline\endcsname%
+ =\relax%
+ }%
+}
+% \end{macrocode}
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \subsubsection{internal library}
+%
+% \parag{global variable}
+%
+% \begin{macrocode}
+\newif\ifft@box@has@maleline
+\newif\ifft@widest@has@no@maleline
+\newlength{\ft@len}
+\newlength{\ft@width}
+\newlength{\ft@height}
+\newlength{\ft@depth}
+\newlength{\ft@theight}
+\newlength{\ft@x}
+\newlength{\ft@xx}
+\newlength{\ft@y}
+\newlength{\ft@yy}
+% \end{macrocode}
+%
+% \parag{utility function}
+%
+% \DescribeMacro{\ft@namexdef}
+% \DescribeMacro{\ft@namexdefstrip}
+% \NoDescription
+% \begin{macrocode}
+\newcommand{\ft@namexdef}[2]{% name value
+ \global\expandafter\edef\csname#1\endcsname{#2}%
+ %\expandafter\xdef\csname#1\endcsname{#2}%
+ \ft@dbgmsg{xdef #1 #2}%
+}
+\newcommand{\ft@namexdefstrip}[2]{% name length
+ \ft@namexdef{#1}{\strip@pt#2}%
+}
+% \end{macrocode}
+%
+% \DescribeMacro{\ft@savenamebox}
+% \DescribeMacro{\ft@newnamebox}
+% \NoDescription
+% \begin{macrocode}
+\newcommand{\ft@savenamebox}[2]{% name contents
+ \expandafter\savebox\expandafter{\csname#1\endcsname}{#2}%
+}
+\newcommand{\ft@newnamebox}[2]{% name contents
+ \global\expandafter\newsavebox\expandafter{\csname#1\endcsname}%
+ \ft@savenamebox{#1}{#2}%
+}
+% \end{macrocode}
+%
+% \DescribeMacro{\ft@nameboxsz}
+% \DescribeMacro{\ft@boxsz}
+% \NoDescription
+% \begin{macrocode}
+\newcommand{\ft@nameboxsz}[4][]{% [width] name ht-value dp-value
+ \ifx#1\empty\else%
+ \expandafter\wd\csname#2\endcsname=#1%
+ \fi%
+ \expandafter\ht\csname#2\endcsname=#3%
+ \expandafter\dp\csname#2\endcsname=#4%
+ \ft@dbgmsg{#2 box, W \the\wd\@nameuse{#2}, H \the\ht\@nameuse{#2},%
+ D \the\dp\@nameuse{#2}}%
+}
+\newcommand{\ft@boxsz}[3]{% box ht-value dp-value
+ \expandafter\ht#1=#2%
+ \expandafter\dp#1=#3%
+ \ft@dbgmsg{#2 box, W \the\wd#1, H \the\ht#1, D \the\dp#1}%
+}
+% \end{macrocode}
+%
+% \DescribeMacro{\ft@list@append}
+% \NoDescription
+% \begin{macrocode}
+\newcommand{\ft@list@append}[3]{% list element
+ \ifx#1\empty%
+ \xdef#1{#2}%
+ \else%
+ \xdef#1{#1,#2}%
+ \fi%
+}
+\iffalse
+\newcommand{\ft@detokenize}[1]{%
+ {%
+ \escapechar=`\ %
+ \catcode`\ =9%
+ %\string#1%
+ \detokenize{#1}%
+ }%
+}
+\fi
+% \end{macrocode}
+%
+% \parag{debugging}
+%
+% \DescribeMacro{\ifftdbg}
+% \DescribeMacro{\ft@dbgmsg}
+% \DescribeMacro{\ft@dbgframe}
+% \DescribeMacro{\ft@dbgplot}
+% \DescribeMacro{\ft@dbgbox}
+% \NoDescription
+% \begin{macrocode}
+\newif\ifftdbg
+\newcommand{\ft@dbgmsg}[1]{%
+ \ifftdbg%
+ \message{#1}%
+ \fi%
+}
+\newcommand{\ft@dbgframe}[2][0,0]{% [point x,y] width,height
+ \ifftdbg%
+ \put(#1){\framebox(#2){}}%
+ \fi%
+}
+\newcommand{\ft@dbgplot}[2][]{%
+ \ifftdbg%
+ \put(#2){\circle{1}{\tiny#1}}%
+ \fi%
+}%
+\newcommand{\ft@dbgbox}[2][]{% [extra-put] box
+ \ifftdbg%
+ \ft@len=\dimexpr\ht#2 + \dp#2\relax%
+ \begin{picture}(\strip@pt\wd#2,\strip@pt\ht#2)(0,-\strip@pt\dp#2)%
+ \ft@dbgframe[0,-\strip@pt\dp#2]{\strip@pt\wd#2,\strip@pt\ft@len}%
+ %\put(0,0){{\tiny\ft@detokenize{#2}}}%
+ %\put(0,-\strip@pt\dp#2){\usebox{#2}}%
+ \put(0,0){\usebox{#2}}%
+ #1%
+ \end{picture}%
+ \fi%
+}
+% \end{macrocode}
diff --git a/macros/latex/contrib/familytree/ft-marriage.dtx b/macros/latex/contrib/familytree/ft-marriage.dtx
new file mode 100644
index 0000000000..138f8f06f9
--- /dev/null
+++ b/macros/latex/contrib/familytree/ft-marriage.dtx
@@ -0,0 +1,374 @@
+% \iffalse
+% Copyright 2022 Jiro Senju
+%
+% 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/>.
+% \fi
+%
+% \section{Marriage Box (\texttt{ft-marriage.dtx})}
+%
+% \DescribeMacro{\mrrgdef}
+% \cmd{\mrrgdef
+% \marg{new box name}
+% \marg{spouse list A}
+% \marg{oneself}
+% \marg{spouse list B}
+% \oarg{childline xlength}
+% }
+% \medskip
+%
+% Defines a marriage box with a specified name \meta{new box name}.
+% To support remarrying and the concubines, the spouses are specified by
+% a list. The element of the list is a box name defined by |\indvdldef|.
+% \meta{spouse list A} is placed upper side of \meta{oneself}, and
+% \meta{spouse list B} is lower side.
+% All box names are NOT \CS{} (no backslash).
+% \smallskip
+%
+% Aligns them in the same column, and connects them by a double line if the
+% marriage is official. If the marriage is not official (|\private|
+% attribute), uses a dashed double line.
+% Those double line is placed at the center of the length of the name of
+% \meta{oneself}.
+% \smallskip
+%
+% If a spouse has a child (|\haschild| attribute),
+% then the line to their child is drawn from the center of the
+% double line.
+% \smallskip
+%
+% Like |\sblngdef|, the interval box can be inserted if you want more
+% spaces.
+% \bigskip
+%
+% Like |\indvdldef|, some connection points are defined. Their origin
+% is left-bottom of the box and the unit is |pt|.
+%
+% \begin{itemize}
+% \item \meta{box name}|nameCY|
+%
+% the center of the height of the name of \meta{oneself}
+%
+% \item \meta{box name}\meta{individual box name}|nameCY|
+%
+% the center of the height of the name of who has any child-mark
+%
+% \item \meta{box name}\meta{individual box name}|mrrgCY|
+%
+% the center of the double line when any spouse has |\haschild| attribute
+% \end{itemize}
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \subsection{Customization}
+%
+% \DescribeMacro{\mrrgboxcfg}
+% \cmd{\mrrgboxcfg
+% \marg{space between two lines}
+% \marg{space between name and the line}
+% \marg{line length}
+% }
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \clearpage
+% \subsection{Example}
+%
+% \begin{enumerate}
+% \item
+% \srcfig{fig4Robert}
+%
+% \clearpage
+% \item
+% \srcfig{fig4HenryVIII}
+% \end{enumerate}
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \subsection{Layout and connecting in a same generation}
+%
+% It is not a good idea to put everything in a single family tree.
+%
+% For example, see King Henry VIII and his wives. Catherine of Aragon,
+% his first wife was actually a wife of Henry's brother, Arthur. If we
+% put King's siblings to this tree, how would it be looked? It's just
+% ugly and hard to understand in a glance. Let's think more using an
+% example from \refnm{sec:Lily1} again.
+%
+% How can we represent the Petunia -- Lily sisters tree including their husbands.
+% As a first step, define two marriage boxes, and then define the
+% sibling box.
+% \medskip
+%
+% \srcfig{fig4Lily1}
+% \medskip
+%
+% Why is this tree so ugly? There are three points to consider.
+% \begin{enumerate}
+% \item The position of two double lines differ from each other.
+% \item The length of a line to their child differs too. If we connected
+% the child, the ugliness would be improved.
+% \item James interrupts into between Petunia and Lily. It makes the
+% understandability worse.
+% \end{enumerate}
+%
+% On fixing the first point, the position of the double line, the second
+% point will be fixed automatically.
+% The solution is the one already suggested in \refnm{sec:Lily1}, set
+% the width of Lily box to Petunia's.
+% For the third point, the position of James, how about expanding the
+% space as a first step?
+% \medskip
+%
+% \srcfig{fig4Lily2}
+% \medskip
+%
+% Even spreading the space wider, James is still interrupting those two
+% sisters. Does it look better?
+% If we want more, the last way is to switch the position of James and Lily.
+% \medskip
+%
+% \srcfig{fig4Lily3}
+% \medskip
+%
+% Moreover spreading the blank is a good option.
+% \medskip
+%
+% \srcfig{fig4Lily4}
+% \medskip
+%
+% Is this best looking?
+% The easiness of looking is subject to one's opinion or taste.
+% Personally I feel resistance in the order of husband and wife. But also I
+% admit that as long as the main purpose of this tree is to represent those
+% sisters, this position of James is not bad.
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \subsectImpl
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% \parag{Customization}
+%
+% \DescribeMacro{\ftmrrgboxcfg}
+% \DescribeMacro{\mrrgboxcfg}
+%
+% \begin{macrocode}
+\newlength{\ft@mrrgline@sep}
+\setlength{\ft@mrrgline@sep}{4pt}
+\newlength{\ft@mrrgline@sp}
+\setlength{\ft@mrrgline@sp}{.5\ft@unit}
+\newlength{\ft@mrrgline@length}
+\setlength{\ft@mrrgline@length}{1.5\ft@unit}
+\newcommand{\ftmrrgboxcfg}[3]{% sep space length
+ \ifx#1\empty\else%
+ \setlength{\ft@mrrgline@sep}{#1}%
+ \fi%
+ \ifx#2\empty\else%
+ \setlength{\ft@mrrgline@sp}{#2}%
+ \fi%
+ \ifx#3\empty\else%
+ \setlength{\ft@mrrgline@length}{#3}%
+ \fi%
+}
+\ft@alias{mrrgboxcfg}
+% \end{macrocode}
+%
+% \parag{Parsing}
+%
+% \begin{macrocode}
+\newcommand{\ft@mrrg@parse}[1]{% spouse-list
+ \global\ft@height=0pt%
+ \global\ft@width=0pt%
+ \global\ft@box@has@malelinefalse%
+ \@for\@temptokena:=#1\do{%
+ \ifx\@temptokena\empty\else%
+ \xdef\ft@spouse{\@temptokena}%
+ \@ifundefined{\@temptokena ival}{%
+ \@ifundefined{\ft@spouse haschild}{}{%
+ \global\ft@box@has@malelinetrue%
+ }%
+ \setlength{\ft@len}{\wd\@nameuse{\ft@spouse}}%
+ \ifdim\ft@width<\ft@len%
+ \global\ft@width=\ft@len%
+ \fi%
+ \ft@dbgmsg{\ft@spouse, W \the\wd\@nameuse{\ft@spouse},%
+ H \the\ht\@nameuse{\ft@spouse},%
+ D \the\dp\@nameuse{\ft@spouse}}%
+ \global\advance\ft@height \dimexpr\ft@mrrgline@length%
+ + 2\ft@mrrgline@sp\relax%
+ \ft@dbgmsg{\ft@spouse, H \the\ft@height}%
+ }{}%
+ \global\advance\ft@height \dimexpr\ht\@nameuse{\ft@spouse}%
+ + \dp\@nameuse{\ft@spouse}\relax%
+ \ft@dbgmsg{\ft@spouse, h H \the\ft@height}%
+ \fi%
+ }%
+ %
+ \ifft@box@has@maleline%
+ \global\advance\ft@width \ft@namebox@maleline@length%
+ \fi%
+ %
+ \global\ft@depth=\dp\@nameuse{\ft@spouse}%
+ \global\advance\ft@height \dimexpr -2\ft@mrrgline@sp%
+ - \ft@mrrgline@length - \ft@depth\relax%
+ \ft@dbgmsg{final H \the\ft@height, D \the\ft@depth}%
+}
+% \end{macrocode}
+%
+% \parag{The double line}
+%
+% \DescribeMacro{\ft@mrrg@line}
+%
+% \begin{macrocode}
+\newlength{\ft@mrrg@chlen}
+\newcommand{\ft@mrrg@line}[5]{% box-name spouse cx sp length
+ \ft@x=#3%
+ \global\advance\ft@height -#4%
+ \@tempskipb=\dimexpr\ft@mrrgline@sep/2\relax%
+ \edef\@y{\strip@pt\ft@height}%
+ \@ifundefined{#2private}{%
+ \ft@len=#5\relax%
+ \edef\@l{\strip@pt\ft@len}%
+ \put(\strip@pt\dimexpr\ft@x - \@tempskipb, \@y){\line(0,-1){\@l}}%
+ \put(\strip@pt\dimexpr\ft@x + \@tempskipb, \@y){\line(0,-1){\@l}}%
+ }{%
+ % this divisor should match the delta_y for multiput
+ \ft@len=#5\relax%
+ \ft@len=\dimexpr\ft@len/2 + .5pt\relax%
+ \@tempcnta=\dimexpr\ft@len/65536\relax%
+ \multiput(\strip@pt\dimexpr\ft@x - \@tempskipb, \@y)%
+ (0,-2){\@tempcnta}{\line(0,-1){.5}}%
+ \multiput(\strip@pt\dimexpr\ft@x + \@tempskipb, \@y)%
+ (0,-2){\@tempcnta}{\line(0,-1){.5}}%
+ }%
+ \@ifundefined{#2haschild}{}{%
+ \ft@len=#5\relax%
+ \ft@y=\dimexpr\ft@height - \ft@len/2\relax%
+ \put(\strip@pt\dimexpr\ft@x + \@tempskipb,\strip@pt\ft@y)%
+ {\line(1,0){\strip@pt\ft@mrrg@chlen}}%
+ \ft@dbgplot{\strip@pt\ft@x,\strip@pt\ft@y}%
+ \ft@namexdefstrip{#1#2mrrgCY}{\ft@y}%
+ }%
+ \ft@len=#5\relax%
+ \@tempskipa=#4\relax%
+ \global\advance\ft@height \dimexpr -\ft@len - \@tempskipa\relax%
+ \ft@dbgmsg{line #2 H \the\ft@height}%
+}
+% \end{macrocode}
+%
+% \parag{Layout the names}
+%
+% \DescribeMacro{\ft@mrrg@name}
+%
+% \begin{macrocode}
+\newcommand{\ft@mrrg@name}[2]{% box-name individual-name
+ \global\advance\ft@height -\ht\@nameuse{#2}%
+ \put(0,\strip@pt\ft@height){\usebox{\@nameuse{#2}}}%
+ \ft@dbgframe[0,\strip@pt\ft@height]%
+ {\strip@pt\wd\@nameuse{#2},\strip@pt\ht\@nameuse{#2}}%
+ %
+ \@ifundefined{#2hasmaleline}{}{%
+ \ft@x=\@nameuse{#2nameX}pt%
+ \ft@y=\dimexpr\ft@height + \@nameuse{#2nameCY}pt\relax%
+ \ft@len=\dimexpr\ft@width - \@nameuse{#2nameX}pt%
+ %- \ft@namebox@maleline@sp%
+ \relax%
+ \put(\strip@pt\ft@x,\strip@pt\ft@y){\line(1,0){\strip@pt\ft@len}}%
+ \ft@namexdefstrip{#1#2nameCY}{\ft@y}%
+ }%
+ %
+ \@ifundefined{#2hascmark}{}{%
+ \ft@len=\dimexpr\ft@height + \@nameuse{#2nameCY}pt\relax%
+ \ft@namexdefstrip{#1#2nameCY}{\ft@len}%
+ \ft@dbgplot{0,\strip@pt\ft@len}%
+ }%
+ \global\advance\ft@height -\dp\@nameuse{#2}%
+ \ft@dbgmsg{name #2 H \the\ft@height}%
+}
+% \end{macrocode}
+%
+% \subsubsection{Layout and connect the individuals --- core}
+%
+% \DescribeMacro{\ft@mrrg@spouse}
+%
+% \begin{macrocode}
+\newlength{\ft@mrrg@ival}
+\newcommand{\ft@mrrg@spouse}[2]{% box-name list
+ \global\ft@mrrg@ival=0pt%
+ \@for\@temptokena:=#2\do{%
+ \@ifundefined{\@temptokena ival}{%
+ \@tempskipa=\dimexpr\ft@mrrgline@length + \ft@mrrg@ival\relax%
+ \if@tempswa%
+ \ft@mrrg@name{#1}{\@temptokena}%
+ \ft@mrrg@line{#1}{\@temptokena}{\ft@xx}{\ft@mrrgline@sp}%
+ {\@tempskipa}%
+ \else%
+ \ft@mrrg@line{#1}{\@temptokena}{\ft@xx}{\ft@mrrgline@sp}%
+ {\@tempskipa}%
+ \ft@mrrg@name{#1}{\@temptokena}%
+ \fi%
+ \global\ft@mrrg@ival=0pt%
+ }{%
+ \global\advance\ft@mrrg@ival%
+ \dimexpr\ht\@nameuse{\@temptokena}%
+ + \dp\@nameuse{\@temptokena}\relax%
+ }%
+ }%
+}
+% \end{macrocode}
+%
+% \subsubsection{Marriage box --- interface}
+%
+% \DescribeMacro{\ftmrrgdef}
+% \DescribeMacro{\mrrgdef}
+%
+% \begin{macrocode}
+\NewDocumentCommand{\ftmrrgdef}{mmmmO{0pt}}{%
+ % box-name spouse-listA oneself spouse-listB [xline]
+ \ft@xx=\@nameuse{#3nameCX}pt\relax%
+ \ft@mrrg@parse{#2,#3,#4}%
+ %
+ \advance\ft@width #5%
+ \global\ft@mrrg@chlen=\dimexpr\ft@width - \ft@xx%
+ - \ft@mrrgline@sep/2\relax%
+ %
+ \ft@theight=\ft@height%
+ \ft@newnamebox{#1}{%
+ \edef\@w{\strip@pt\ft@width}%
+ \edef\@h{\strip@pt\ft@height}%
+ \begin{picture}(\@w,\@h)%
+ \ft@dbgframe{\@w,\@h}%
+ %
+ \ifx#2\@nil\else%
+ \@tempswatrue%
+ \ft@mrrg@spouse{#1}{#2}%
+ \fi%
+ %
+ \ft@mrrg@name{#1}{#3}%
+ \@ifundefined{#1#3nameCY}{}{%
+ \ft@len=\@nameuse{#1#3nameCY}pt\relax%
+ \ft@dbgplot{1,\strip@pt\ft@len}%
+ \ft@namexdefstrip{#1nameCY}{\ft@len}%
+ }%
+ \@ifundefined{#3hascmark}{}{%
+ \ft@namexdef{#1hascmark}{\@nameuse{#3hascmark}}%
+ }%
+ %
+ \ifx#4\empty\else%
+ \@tempswafalse%
+ \ft@mrrg@spouse{#1}{#4}%
+ \fi%
+ \end{picture}%
+ }%
+ \ft@nameboxsz{#1}{\ft@theight}{\ft@depth}%
+}
+\ft@alias{mrrgdef}
+% \end{macrocode}
diff --git a/macros/latex/contrib/familytree/ft-sibling.dtx b/macros/latex/contrib/familytree/ft-sibling.dtx
new file mode 100644
index 0000000000..fcb6a3645d
--- /dev/null
+++ b/macros/latex/contrib/familytree/ft-sibling.dtx
@@ -0,0 +1,333 @@
+% \iffalse
+% Copyright 2022 Jiro Senju
+%
+% 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/>.
+% \fi
+%
+% \section{Sibling Box (\texttt{ft-sibling.dtx})}
+%
+% \DescribeMacro{\sblngdef}
+% \cmd{\sblngdef
+% \marg{new box name}
+% \marg{name list of individual boxes}
+% }
+% \medskip
+%
+% \marg{name list of individual boxes} is the comma separated box names
+% which are defined by |\indvdldef|.
+% They are aligned and connected by a line.
+% All names are NOT \CS{} (no backslash).
+%
+% If any of the siblings has a |\maleline| attribute, then the length of
+% all lines are set to the longest one.
+% \medskip
+%
+% Like |\indvdldef|, |\sblngdef| defines a few connection points (\CS)
+% to be used later. The origin is left-bottom of the box and the unit is |pt|.
+%
+% \begin{itemize}
+% \item \meta{box name}|nameCY|
+% \par
+% Center of the line which connects all the siblings.
+% \par
+% The line begins at the head of the child-mark of the
+% first element of the given list, and ends at the last element.
+%
+% \item \meta{box name}\meta{individual box name}|nameCY|
+% \par
+% Center of the height for each individual name.
+% \par
+% In other words, shifted \meta{individual box name}|nameCY| which
+% |\indvdldef| defined.
+% \end{itemize}
+% \medskip
+%
+% \noindent
+% \DescribeMacro{\ivaldef}
+% \cmd{\ivaldef
+% \marg{new box name}
+% \marg{length}
+% }
+% \medskip
+%
+% Sometimes an extra space is necessary between the siblings who have
+% many descendants.
+% For such spaces, you can define an interval box by |\ivaldef|. It
+% defines an blank box who has a specified size. There are three
+% pre-defined interval boxes, |\ival|, |\ivali|, and |\ivalii|. They
+% have the size of |0.5em|, |1em|, |2em| for each.
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \subsection{Customization}
+%
+% \DescribeMacro{\sblngboxcfg}
+% \cmd{\sblngboxcfg
+% \marg{space between the siblings}
+% }
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \subsection{Example}
+%
+% \begin{enumerate}
+% \item
+% \srcfig{fig2base}
+%
+% \item
+% \srcfig{fig2sis}
+%
+% \item
+% \srcfig{fig2ival}
+% \end{enumerate}
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \subsectImpl
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \subsubsection{Interval box}
+%
+% \DescribeMacro{\ftivaldef}
+% \DescribeMacro{\ivaldef}
+%
+% \begin{macrocode}
+\newcommand{\ftivaldef}[2]{% box-name length
+ \ft@newnamebox{#1}{\vbox to #2{\hsize=1pt}}%
+ \ft@len=#2%
+ \ft@namexdefstrip{#1ival}{\ft@len}% just a flag
+ \divide\ft@len 2%
+ \ft@namexdefstrip{#1nameCY}{\ft@len}%
+}
+\ft@alias{ivaldef}
+% \end{macrocode}
+%
+% \parag{Pre-defined interval boxes}
+%
+% \DescribeMacro{\ftival}
+% \DescribeMacro{\ival}
+% \NoDescription
+% \begin{macrocode}
+\ftivaldef{ftival}{.5\ft@unit}
+\ft@alias{ival}
+\ft@alias{ivalnameCY}
+\ft@alias{ivalival}
+% \end{macrocode}
+%
+% \DescribeMacro{\ftivali}
+% \DescribeMacro{\ivali}
+% \NoDescription
+% \begin{macrocode}
+\ftivaldef{ftivali}{1\ft@unit}
+\ft@alias{ivali}
+\ft@alias{ivalinameCY}
+\ft@alias{ivaliival}
+% \end{macrocode}
+%
+% \DescribeMacro{\ftivalii}
+% \DescribeMacro{\ivalii}
+% \NoDescription
+% \begin{macrocode}
+\ftivaldef{ftivalii}{2\ft@unit}
+\ft@alias{ivalii}
+\ft@alias{ivaliinameCY}
+\ft@alias{ivaliiival}
+% \end{macrocode}
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \parag{Customization}
+%
+% \DescribeMacro{\ftsblngboxcfg}
+% \DescribeMacro{\sblngboxcfg}
+%
+% \begin{macrocode}
+\newlength{\ft@sblng@vsp}
+\setlength{\ft@sblng@vsp}{.5\baselineskip}%
+\newcommand{\ftsblngboxcfg}[1]{% space-length
+ \global\ft@sblng@vsp=#1%
+}
+\ft@alias{sblngboxcfg}
+% \end{macrocode}
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \subsubsection{Sibling box --- core}
+%
+% If any of the siblings has an attributes |\maleline| or alike, then
+% finds the longest one and sets its length to all others.
+% Between the name and |\maleline|, insert a space
+% |\ft@namebox@maleline@sp|.
+%
+% \begin{macrocode}
+\newcommand{\ft@sblng@maleline}[2]{% sibling y
+ \@ifundefined{#1hasmaleline}{}{%
+ \ft@x=\@nameuse{#1nameX}pt\relax%
+ \ifdim\ft@x<\ft@width%
+ \put(\strip@pt\ft@x,\strip@pt#2){%
+ \line(1,0){\strip@pt\dimexpr\ft@width - \ft@x}%
+ }%
+ \fi%
+ }%
+}
+% \end{macrocode}
+%
+% \DescribeMacro{\ft@sblng@connect}
+%
+% \begin{macrocode}
+\newlength{\ft@c}
+\newcommand{\ft@sblng@connect}[1]{% box-name
+ %
+ % draw a line to connect all the siblings
+ % length = eldest CY - youngest CY
+ % and calculate nameCY of the box
+ % nameCY = length/2 + youngest CY
+ %
+ \ft@y=\@nameuse{#1\ft@lastcmark nameCY}pt%
+ \ft@dbgplot{1,\strip@pt\ft@y}%
+ \ft@yy=\@nameuse{#1\ft@firstcmark nameCY}pt%
+ \ft@dbgplot{1,\strip@pt\ft@yy}%
+ \ft@len=\dimexpr\ft@yy - \ft@y\relax%
+ %
+ \ft@c=\dimexpr\ft@len/2 + \ft@y\relax%
+ \ft@namexdefstrip{#1nameCY}{\ft@c}%
+ \ft@dbgplot{1,\strip@pt\ft@c}%
+ %
+ \ifnum\@nameuse{\ft@lastcmark hascmark}=\ftadopted%
+ \advance\ft@y -\dimexpr\ft@cmarkbox@adopted@sep/2\relax%
+ \advance\ft@len \dimexpr\ft@cmarkbox@adopted@sep/2\relax%
+ \fi%
+ \ifnum\@nameuse{\ft@firstcmark hascmark}=\ftadopted%
+ \advance\ft@len \dimexpr\ft@cmarkbox@adopted@sep/2\relax%
+ \fi%
+ %
+ \ifdim\ft@len<2pt%
+ %\ft@len=\@nameuse{\ft@firstcmark nameCY}pt\relax%
+ \else%
+ \advance\ft@y -\dimexpr\arrayrulewidth/2\relax%
+ \advance\ft@len \arrayrulewidth%
+ \put(0,\strip@pt\ft@y){\line(0,1){\strip@pt\ft@len}}%
+ \fi%
+}
+% \end{macrocode}
+%
+% \DescribeMacro{\ft@sblng@layout}
+%
+% \begin{macrocode}
+\newcommand{\ft@sblng@layout}[2]{% box-name individual-name-list
+ \ft@newnamebox{#1}{%
+ \edef\@w{\strip@pt\ft@width}%
+ \edef\@h{\strip@pt\ft@height}%
+ \begin{picture}(\@w,\@h)%
+ \ft@dbgframe{\@w,\@h}%
+ %
+ \@for\@temptokena:=#2\do{%
+ \edef\ft@sblng@name{\@temptokena}%
+ \ft@dbgmsg{H \the\ft@height,%
+ \ft@sblng@name nameCY \@nameuse{\ft@sblng@name nameCY}pt,%
+ \the\ft@y}%
+ %
+ % calculate the nameCY for each
+ \advance\ft@height -\ht\@nameuse{\ft@sblng@name}%
+ \global\ft@y=\dimexpr\@nameuse{\ft@sblng@name nameCY}pt%
+ + \ft@height\relax%
+ \ft@dbgplot{0,\strip@pt\ft@y}%
+ \ft@namexdefstrip{#1\ft@sblng@name nameCY}{\ft@y}%
+ %
+ % align the malelines
+ \ft@sblng@maleline{\ft@sblng@name}{\ft@y}%
+ %
+ % place the individual boxes
+ \put(0,\strip@pt\ft@height){\usebox{\@nameuse{\ft@sblng@name}}}%
+ \advance\ft@height -\dimexpr\dp\@nameuse{\ft@sblng@name}%
+ + \ft@sblng@vsp\relax%
+ }%
+ %
+ % connect them
+ \ifx\ft@firstcmark\relax\else%
+ \ifx\ft@firstcmark\ft@lastcmark\else%
+ \ft@sblng@connect{#1}%
+ \fi%
+ \fi%
+ \end{picture}%
+ }%
+ % height should hold the original value
+ \ft@nameboxsz{#1}{\ft@height}{\ft@depth}%
+}
+% \end{macrocode}
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% \subsubsection{Sibling box --- interface}
+%
+% \DescribeMacro{\ftsblngdef}
+% \DescribeMacro{\sblngdef}
+%
+% \begin{macrocode}
+\newcommand{\ftsblngdef}[2]{% box-name comma-separated-individuals
+ %
+ % calculate the size of the box
+ \ft@width=0pt%
+ \ft@height=0pt%
+ \ft@theight=0pt%
+ \ft@box@has@malelinefalse%
+ \@tempswatrue%
+ \let\ft@firstcmark=\relax%
+ \let\ft@lastcmark=\relax%
+ \def\ft@dpri##1{\ft@dbgmsg{##1 W \the\ft@width, H \the\ft@height,%
+ D \the\ft@depth}}%
+ \ft@dpri{h0}%
+ \@for\@temptokena:=#2\do{%
+ \if@tempswa%
+ \xdef\ft@eldest{\@temptokena}%
+ \@tempswafalse%
+ \fi%
+ \xdef\ft@youngest{\@temptokena}%
+ \@ifundefined{ft@firstcmark}{%
+ \@ifundefined{\ft@youngest hascmark}{}{%
+ \global\let\ft@firstcmark=\ft@youngest%
+ }%
+ }{%
+ \@ifundefined{\ft@youngest hascmark}{}{%
+ \global\let\ft@lastcmark=\ft@youngest%
+ }%
+ }%
+ \@ifundefined{\ft@youngest hasmaleline}{}{%
+ \global\ft@box@has@malelinetrue%
+ }%
+ %
+ \setlength{\ft@len}{\wd\@nameuse{\ft@youngest}}%
+ \ifdim\ft@width<\ft@len%
+ \global\ft@width=\ft@len%
+ \@ifundefined{\ft@youngest hasmaleline}{%
+ \global\ft@widest@has@no@malelinetrue%
+ }{%
+ \global\ft@widest@has@no@malelinefalse%
+ }%
+ \fi%
+ \global\advance\ft@theight \dimexpr\ht\@nameuse{\ft@youngest}%
+ + \dp\@nameuse{\ft@youngest} + \ft@sblng@vsp\relax%
+ \ft@dpri{\ft@youngest}%
+ }%
+ \advance\ft@theight -\ft@sblng@vsp%
+ \ft@depth=\dp\@nameuse{\ft@youngest}%
+ \ft@height=\ft@theight%
+ \advance\ft@height -\ft@depth%
+ \ifft@widest@has@no@maleline%
+ \ifft@box@has@maleline%
+ \global\advance\ft@width \dimexpr\ft@namebox@maleline@sp%
+ + \ft@namebox@maleline@length\relax%
+ \fi%
+ \fi%
+ %
+ % layout the all boxes
+ \ft@sblng@layout{#1}{#2}%
+ \ft@dbgbox{\@nameuse{#1}}%
+}
+\ft@alias{sblngdef}
+% \end{macrocode}
diff --git a/macros/latex/contrib/familytree/samples/Asai.pdf b/macros/latex/contrib/familytree/samples/Asai.pdf
new file mode 100644
index 0000000000..60cac91c67
--- /dev/null
+++ b/macros/latex/contrib/familytree/samples/Asai.pdf
Binary files differ
diff --git a/macros/latex/contrib/familytree/samples/Asai/0Ichi.tex b/macros/latex/contrib/familytree/samples/Asai/0Ichi.tex
new file mode 100644
index 0000000000..248dc39fef
--- /dev/null
+++ b/macros/latex/contrib/familytree/samples/Asai/0Ichi.tex
@@ -0,0 +1,43 @@
+\indvdldef{信長}{織田信長}
+
+\indvdldef[\blank]{勝家}{柴田勝家}[秀吉との合戦で自害]
+
+\indvdldef{お犬}{\fbox{於犬}}[おいぬ]
+\indvdldef[\blank]{信方}{佐治為興(信方)}[\haschild]
+\indvdldef[\blank]{信良}{細川昭元(信良)}[\haschild]
+\mrrgdef{お犬夫婦}{信方,信良}{お犬}{}[\dimexpr\wd\勝家 - \wd\信方]
+
+\indvdldef{お市}{\fbox{於市}}[おいち,長政の継室,勝家の正室,勝家と
+ ともに自害]
+\indvdldef[\blank]{長政}{浅井長政}[あさい あざい?,信長との合戦で自
+ 害,\haschild]
+\mrrgdef{お市夫婦}{長政,勝家}{お市}{}
+
+\sblngdef{信長兄妹}{信長,ival,お犬夫婦,ival,お市夫婦}
+
+\savebox{\abox}{
+ \parbox{.5\textwidth}{
+ \small%
+ なんでそんな名前なの?\par
+ と言うのは置いといて。\par
+ \smallskip
+
+ \begin{itemize}
+ \itemsep=\medskipamount
+
+ \item
+ お犬の方は二度結婚し、二度とも子をもうけた。
+ 佐治為興の息子が後で登場する。
+ \item
+ お市の方も二度結婚し、最初の結婚で娘を三人産んだ。
+ これが主人公。
+ \item
+ お市の方は物語によく取り上げられ、大層美人だったという話しだ。
+ 秀吉は恋い焦がれたが、それでいて戦い、滅ぼすという時代。
+ \end{itemize}
+ }
+}
+\hfil
+\fbox{\usebox{\信長兄妹}}
+\hfil
+\raisebox{\dimexpr(\ht\信長兄妹 - \ht\abox)/2}{\usebox{\abox}}
diff --git a/macros/latex/contrib/familytree/samples/Asai/0sis.tex b/macros/latex/contrib/familytree/samples/Asai/0sis.tex
new file mode 100644
index 0000000000..00153205f2
--- /dev/null
+++ b/macros/latex/contrib/familytree/samples/Asai/0sis.tex
@@ -0,0 +1,77 @@
+
+\indvdldef{一成}{一成}[江の従兄,江の最初の夫?]
+%与九郎 後妻には信長の娘・お振
+\indvdldef{秀休}{秀休(中川)}
+\sblngdef{佐治信方の子}{一成,秀休}
+\indvdldef{元勝}{元勝(細川)}% 細川昭元の子
+
+\ftundef{お犬,お犬夫婦}
+\indvdldef{お犬}{\fbox{於犬}}[一時期 茶々の後見]
+\mrrgdef{お犬夫婦}{ivalii,信方,ivalii,信良}{お犬}{}
+\gensdef{お犬親子}{お犬夫婦}{%
+ {信方}{佐治信方の子},%
+ {信良}{元勝}%
+}
+
+\indvdldef{茶茶}{\fbox{茶々}}[秀吉の側室,\femaleline]
+\indvdldef{初}{\fbox{初}}[従兄 京極高次の正室,\femaleline]
+\indvdldef{江}{\fbox{江}}[小督 おごう,豊臣秀勝の正室,徳川秀忠の継
+ 室,\femaleline]
+\sblngdef{三姉妹}{茶茶,初,江}
+
+\ftundef{お市,長政,お市夫婦}
+\indvdldef{お市}{\fbox{於市}}
+\indvdldef[\blank]{長政}{浅井長政}[\haschild]
+\mrrgdef{お市夫婦}{ivali,長政}{お市}{}[\dimexpr\wd\お犬 - \wd\長政]
+\gensdef{お市親子}{お市夫婦}{%
+ {長政}{三姉妹}%
+}
+
+\sblngdef{お市姉妹}{お犬親子,ival,お市親子}
+\fbox{\usebox{\お市姉妹}}
+\bigskip
+
+\begin{multicols}{2}
+\begin{itemize}
+\itemsep=\medskipamount
+\item
+この時代、結婚相手はいとこ、というのが多い。
+次女 初、三女 江の相手がそう。
+
+\item
+お犬の方は長女 茶々の面倒をみたり、先夫との息子と三女 江を結んだりと大活
+躍か。
+
+茶々の後見となっていた期間はどんなもんだろう? 佐治為興が戦死
+% 1574
+したため
+実家に戻り、再婚
+% 1577
+するまでの間なのだろうか? だとすると茶々
+% 1569生
+が五歳から八歳までか。
+お市の方は存命だし、茶々もまだ可愛い頃だろうから、それほど手を焼くことも無
+かったのではなかろうか。
+
+\item
+お犬の方の弔いの際には先夫との息子が立ち回ったそうで、親子仲は良かった
+らしい。
+\end{itemize}
+\bigskip
+
+人物の話からは逸れるが、
+{\texttt{\textbackslash mrrgdef}}
+{interface}
+の欠点が分かった。
+間隔を空けるには
+{\texttt{ivalbox}}
+を挿入するが、
+{spouse}
+名の前に入れなければならない。
+
+これは良くない。早々に直したいが、さてどうやろう。
+
+{familytree}
+{pkg}
+の今後の課題としたい。
+\end{multicols}
diff --git a/macros/latex/contrib/familytree/samples/Asai/1Chacha.tex b/macros/latex/contrib/familytree/samples/Asai/1Chacha.tex
new file mode 100644
index 0000000000..6037d27eda
--- /dev/null
+++ b/macros/latex/contrib/familytree/samples/Asai/1Chacha.tex
@@ -0,0 +1,64 @@
+
+\indvdldef[\adopted]{完子}[猶子]{\fbox{完子}}[さだこ,江と秀勝の娘,九条
+ 幸家の正室,貞明皇后(大正天皇の皇后)につながる]
+
+\ftundef{茶茶}
+\indvdldef{茶茶}{\fbox{茶々}}
+ [\maleline,淀殿,生\ymd{1569}? 没\ymd{1615}]
+\indvdldef[\blank]{秀吉}{豊臣秀吉}[\haschild,\private]
+\mrrgdef{茶茶夫婦}{ivalv,ivalii,秀吉}{茶茶}{}
+
+\indvdldef{鶴松}{鶴松}[早世]
+\indvdldef{秀頼}{秀頼}[江の娘 千姫の夫]% 従妹
+\sblngdef{秀吉の子}{鶴松,秀頼}
+
+\gensdef{茶茶親子}{茶茶夫婦}{%
+ {秀吉}{秀吉の子},%
+ {茶茶}{完子}%
+}
+\fbox{\usebox{\茶茶親子}}
+\bigskip
+
+\begin{multicols}{2}
+\begin{itemize}
+\itemsep=\medskipamount
+
+\item
+これも物語でよくあるが、茶々は親の仇の秀吉の側室になった。淀殿と呼ばれ、
+秀吉亡き後の強情ぶりは有名だが、そんなに気が強いのならば側室になる際に
+も一波乱あったのではなかろうか。
+
+\item
+秀吉は元々お市の方に惚れており、自分との合戦でお市の方が自害し、後にそ
+の娘 茶々を側室にした。
+助平に権力を持たすと美人に類が及ぶということか。
+でも衆道が当然の戦国大名の中で、秀吉はそっちに見向きもしなかった。
+
+三姉妹の中で茶々が一番母親似の美人だ(だから秀吉が側室にした)という話
+と、そうでもないという話と両方ある。
+
+\item
+秀吉には中々子が出来なかった。実子を産んだと確認できているのは茶々だけ。
+第一子は早世し、誕生の喜びが大きかっただけに落胆も相当なものだったらし
+い。
+
+\item
+第一子早世後、実子を諦め、養子 秀次および秀俊を後継者候補とした後に、第二子 秀頼が
+誕生した。既に関白職を譲られていた秀次は冷遇されるようになり、最終的に
+切腹させられた。秀吉が一方的に非道という話もあれば、秀次が関白職を返さ
+ず対立したとか、残虐行為が甚だしかったとかいう話もある。
+
+もう一人の後継者候補 秀俊は、秀吉正室 ねねの甥であり血縁も近かったが、
+小早川家へ養子に出された。後継者候補ということで諸大名が随分接待し、子
+供の頃から酒を呑んでいた。その後候補から外れても酒は呑み続け、早くからア
+ルコール中毒になっていたらしい。
+これが後の小早川秀秋であり、その名を秀吉死後の関ヶ原で歴史に大きく残す
+ことになる。
+
+\item
+茶々は妹 江の再々婚を契機に江の娘 完子を猶子にした。養子みたいなもんら
+しい。
+しっかり養育したらしく、完子は公家に嫁ぎ、子を残した。子孫は現在の皇室
+につながる。
+\end{itemize}
+\end{multicols}
diff --git a/macros/latex/contrib/familytree/samples/Asai/2Hatsu.tex b/macros/latex/contrib/familytree/samples/Asai/2Hatsu.tex
new file mode 100644
index 0000000000..48b22476ef
--- /dev/null
+++ b/macros/latex/contrib/familytree/samples/Asai/2Hatsu.tex
@@ -0,0 +1,76 @@
+
+\indvdldef{忠高}{忠高}[側室の子]
+\indvdldef[\adopted]{初姫}{\fbox{初姫}}[江と秀忠の娘,忠高の正室]
+\indvdldef[\adopted]{古奈}{\fbox{古奈}}[高次の妹の娘]
+\sblngdef{初の子}{初姫,古奈}
+%\fbox{\usebox{\初の子}}
+\let\初の子nameCX=\初姫nameCX
+\mrrgdef{初姫夫婦}{忠高}{初の子}{}
+%\fbox{\usebox{\初姫夫婦}}
+
+\ftundef{初}
+\indvdldef{初}{\fbox{初}}[\femaleline,生\ymd{1570} 没\ymd{1633}]
+\indvdldef{高次}{高次}[\maleline]
+\mrrgdef{初夫婦}{}{高次}{ivalii,ivali,ival,初}[1zw]
+
+\ftundef{初親子}
+\let\初姫夫婦nameCY=\初姫夫婦忠高nameCY
+\gensdef{初親子}{初夫婦}{%
+ {高次}{初姫夫婦}%
+}
+%\fbox{\usebox{\初親子}}
+
+\indvdldef{マリア}{\fbox{マリア}}
+\ftundef{長政}
+\indvdldef{長政}{浅井長政}%[\maleline]
+\ftsblngboxcfg{\baselineskip}
+\sblngdef{長政姉弟}{マリア,ival,長政}
+\ftsblngboxcfg{.75\baselineskip}
+%\fbox{\usebox{\長政姉弟}}
+\let\長政姉弟nameCX=\マリアnameCX
+
+\indvdldef[\blank]{高吉}{京極高吉}[\haschild]
+\mrrgdef{マリア夫婦}{高吉}{長政姉弟}{}
+\let\マリア夫婦nameCY=\マリア夫婦高吉mrrgCY
+%\fbox{\usebox{\マリア夫婦}}
+
+\gensdef{マリア親子}{マリア夫婦}{%
+ {高吉}{初親子}%
+}
+\fbox{\usebox{\マリア親子}}
+\bigskip
+
+\begin{multicols}{2}
+\begin{itemize}
+\itemsep=\medskipamount
+
+\item
+次女 初は父の姉の子、要するに従兄に嫁いだ。子はなく、養女を二人とった。
+一人は江の娘、というか将軍の娘 初姫。その初姫と夫が側室に産ませた子を
+結婚させる。凄いな、これ。実子ではないとは言え、娘と息子(相当)の結婚。
+これは初が嫁いだ家のことを最優先に考えたということだろうか。
+
+でも初姫の結婚は幸せではなかったらしく、父親である二代 秀忠、弟である三
+代 家光は結婚相手に対し怒ったという話がある。
+
+\item
+豊臣と徳川が争った時に初は和議に尽力したとある。自分の姉と妹それぞれの
+嫁ぎ先だ。存在感が大きく感じられないのは性格が穏やかなのだろうか。と言
+うか、姉と妹がきつすぎるのかもしれない。既に夫と死別していたので自分で
+頑張ったらしい。
+
+\item
+長政の姉のマリアとは洗礼名だが、本名が分からないらしい。敬虔かつ質素な
+生活だったとのことだが、戦国の世をどう見ていたのだろうか。
+
+\end{itemize}
+\bigskip
+
+{\spaceskip=1ex
+人物の話からは逸れるが、この図をlatexするのは難しかった。三世代の婚姻
+関係と親子関係が密接だ。familytree pkg本来の機能では対応仕切れず、所々
+座標を写すという細工を入れている。
+
+familytree pkgの今後の課題としたい。
+}
+\end{multicols}
diff --git a/macros/latex/contrib/familytree/samples/Asai/3Gou.tex b/macros/latex/contrib/familytree/samples/Asai/3Gou.tex
new file mode 100644
index 0000000000..4eca873b0f
--- /dev/null
+++ b/macros/latex/contrib/familytree/samples/Asai/3Gou.tex
@@ -0,0 +1,104 @@
+
+\ftundef{完子}
+\indvdldef{完子}{\fbox{完子}}[後に茶々の猶子]
+
+\indvdldef{千姫}{\fbox{千姫}}[従兄 豊臣秀頼の正室,本多忠刻の正室]
+\indvdldef{珠姫}{\fbox{珠姫}}[従兄 前田利常の正室]%三男五女
+\indvdldef{勝姫}{\fbox{勝姫}}[従兄 松平忠直の正室]
+% 長男:光長
+% 長女:寧子 - 徳川秀忠養女、高松宮好仁親王妃
+% 次女:鶴子 - 徳川家光養女、九条道房正室
+\ftundef{初姫}
+\indvdldef{初姫}{\fbox{初姫}}[後に姉 初 の養子,又従兄 京極忠高の正室]
+\indvdldef{家光}{家光}
+\indvdldef{忠長}{忠長}
+\indvdldef{和子}{\fbox{和子}}[後水尾天皇の皇后,明正天皇の母]
+\sblngdef{秀忠の子}{千姫,珠姫,勝姫,初姫,家光,忠長,和子}
+\ftundef{江}
+\indvdldef{江}{\fbox{江}}[生\ymd{1573} 没\ymd{1626}]
+\ftundef{一成}
+\indvdldef[\blank]{一成}{佐治一成}[お犬の子 江の従兄,江の最初の夫?]
+\indvdldef[\blank]{秀勝}{豊臣秀勝}[\haschild,秀吉の甥]
+\indvdldef[\blank]{秀忠}{徳川秀忠}[\haschild]
+\mrrgdef{江夫婦}{ivali,一成,ivalx,ivalx,秀勝,ivalv,秀忠}{江}{}
+\gensdef{江親子}{江夫婦}{%
+ {秀勝}{完子},%
+ {秀忠}{秀忠の子}%
+}
+
+\savebox{\abox}{
+ \parbox{\dimexpr\textwidth - \wd\江親子 - 3zw}{
+ \begin{itemize}
+ \itemsep=\medskipamount
+ \item
+ 三女 江は子が多い。
+ 再婚で一女、再々婚で二男五女。子は皆幸せに巣立った、と言いたいと
+ ころだが、次男 忠長はそうでもなかったようだ。
+
+ この辺の話は長男 家光の乳母 春日の局関係でよく出て来るが、
+ 幼少期は家光よりも忠長の方が出来が良く、母 江からも可愛がられ将
+ 来を有望視されていたけれど、春
+ 日の局が家康に直訴した結果「三代目は家光」と周知された。
+ 忠長の姓は徳川から松平に変えられ、江の没後は忠長の乱暴が目立つよ
+ うになる。家光は初めはできるだけ穏やかに遠ざけていたけれど、最終
+ 的に切腹となった。
+
+ うん、なんか秀頼誕生後の秀次の話みたいだ。
+
+ \item
+ 秀勝と江の娘 完子は茶々に引き取られ、公家に嫁いだ。
+
+ \item
+ 秀忠と江の長女 千姫は家康に大層可愛がられたという話がある。祖母
+ である お市の才覚と容姿を受け継いだとか。政略結婚で豊臣秀頼、本
+ 多忠刻と結婚し、夫婦仲は円満だったそうな。
+
+ \item
+ 次女 珠姫は加賀前田に嫁ぎ、今も金沢では有名人。夫婦仲は円満だっ
+ たが、珠姫の乳母が余計なことをして最後はちと悲しい話。
+ \end{itemize}
+ }
+}
+\hfil
+\fbox{\usebox{\江親子}}
+\hfil
+\raisebox{\dimexpr(\ht\江親子 - \ht\abox)}{\usebox{\abox}}
+
+\begin{multicols}{2}
+\begin{itemize}
+\itemsep=\medskipamount
+\item
+ 三女 勝姫も嫁いで幸せだったと思われるが、夫の方がいまいちな奴で
+ 早くに隠居させられた。勝姫はその後も口をよく挟むうるさい奴だった
+ ようだ。
+
+\item
+ 四女 初姫は江の妹である 初 の養子になる。
+
+\item
+ 五女 和子は後水尾天皇に嫁いだ。幸せと思われるが、うーん、入内時
+ に天皇が女官との間に子をもうけていたことが発覚し、ごたごたがあった。
+ 当時は幕府が朝廷に対する締め付けを強化し始めており、和子が入内
+ した後も事件が起こり、天皇は幕府に腹を立てたのか雲隠れするように
+ 皇位を突如譲位してしまう。と言っても後継男子はおらず、次女の女一宮
+ 興子が天皇となる(明正天皇)。今のところ、これが最後の女性天
+ 皇ということだ。
+ 個人的には女性も女系(母系)も認めて、範囲や優先順位を決めるのが
+ 良いと思うがなぁ。
+
+ 後水尾は上皇となって院政を敷いたので、明正天皇はあまり活躍できなかっ
+ たようだ。でも和子は夫を理解し、賛同していた。つまり兄である
+ 三代 家光とはちょっと対立状態があったらしい。そのせいか和子以降は長いこと
+ 徳川からの入内はない(昭和時代になって慶喜の孫が昭和天皇の弟に嫁いだ)。
+ 逆に天皇家から徳川への降嫁はあり、これが有名な十四代 家茂に嫁いだ和
+ 宮親子(ちかこ)。
+\end{itemize}
+
+人物の話からは逸れるが、この図をあまり綺麗ではない。
+婚姻関係を表す二重線から子へつながる線を描く場合、二重線の中点を始点と
+するのが良いと考えていたが、江の系図では秀忠との子が多く、秀勝との子は
+一人だけだ。結果的に秀勝の位置が大きく離れることになってしまう点が良く
+ない。
+
+この点もfamilytree pkgの今後の課題としたい。
+\end{multicols}
diff --git a/macros/latex/contrib/familytree/samples/Asai/Asai.tex b/macros/latex/contrib/familytree/samples/Asai/Asai.tex
new file mode 100644
index 0000000000..a0eb55af47
--- /dev/null
+++ b/macros/latex/contrib/familytree/samples/Asai/Asai.tex
@@ -0,0 +1,53 @@
+\documentclass[
+ tate, landscape,
+ draft,
+ jlreq_notes,open_bracket_pos=nibu_tentsuki
+]{jlreq}
+\AtBeginDvi{\special{papersize=\the\paperwidth,\the\paperheight}}
+
+\makeatletter
+\let\iftate=\if@tate
+\makeatother
+
+\input{../../fonts}
+%\usepackage{otf}
+
+\usepackage{multicol}
+\columnseprule=\arrayrulewidth
+\usepackage{familytree}
+
+\ftoptboxcfg{}{}{}{1}
+\ftsblngboxcfg{.75\baselineskip}
+\ivaldef{ivalv}{5zh}
+\ivaldef{ivalx}{10zh}
+
+\newsavebox{\abox}
+\newcommand{\jslash}{~\tatechuyoko{{\large\slash}} \allowbreak}
+
+\ModifyPageStyle{plain}{nombre_position={bottom-center}}
+\begin{document}
+\pagestyle{plain}
+
+familytree sample
+
+\textgt{\large 浅井三姉妹家系図}
+\bigskip
+
+\newcommand{\f}[1]{%
+ \iftate%
+ \tatechuyoko{\texttt{(#1)}}%
+ \else%
+ \texttt{(#1)}%
+ \fi%
+ \medskip%
+ %
+ \input{#1}%
+ \clearpage%
+}
+
+\f{0Ichi}
+\f{0sis}
+\f{1Chacha}
+\f{2Hatsu}
+\f{3Gou}
+\end{document}
diff --git a/macros/latex/contrib/familytree/samples/Asai/Makefile b/macros/latex/contrib/familytree/samples/Asai/Makefile
new file mode 100644
index 0000000000..1c5dfb956a
--- /dev/null
+++ b/macros/latex/contrib/familytree/samples/Asai/Makefile
@@ -0,0 +1,19 @@
+
+Dir ?= /tmp
+Tgt = ${Dir}/Asai.pdf
+
+LATEX ?= platex -kanji=euc
+include ../../cmd.mk
+
+all: ${Tgt}
+
+clean:
+ ${RM} *~ ${Tgt}
+
+install:
+ install -m 444 -pD ${Tgt} \
+ ${InstallDir}/source/latex/${Name}/$(notdir ${Tgt})
+
+${Tgt}: ${Dir}/%.pdf: %.tex ${Dir}/familytree.sty
+ $(call Latex, $<)
+ cd ${Dir}; ${DVIPDFMX} $(basename $<).dvi
diff --git a/macros/latex/contrib/familytree/samples/Crawley.pdf b/macros/latex/contrib/familytree/samples/Crawley.pdf
new file mode 100644
index 0000000000..4b068ec33c
--- /dev/null
+++ b/macros/latex/contrib/familytree/samples/Crawley.pdf
Binary files differ
diff --git a/macros/latex/contrib/familytree/samples/Crawley.tex b/macros/latex/contrib/familytree/samples/Crawley.tex
new file mode 100644
index 0000000000..8977c9ca33
--- /dev/null
+++ b/macros/latex/contrib/familytree/samples/Crawley.tex
@@ -0,0 +1,258 @@
+\documentclass{article}
+\AtBeginDvi{\special{papersize=\the\paperwidth,\the\paperheight}}
+
+\makeatletter
+\let\stript=\strip@pt
+\makeatother
+
+\input{../fonts}
+\usepackage[dvipdfm,a4paper]{geometry}
+\usepackage{familytree}
+
+\newcommand{\nee}[1]{%
+ \\{\relsize{-1}(n\'{e}e #1)}%
+}
+
+\newcommand{\cname}[2][0]{%
+ \ifnum#1=1\let\mybox=\fbox\else\let\mybox=\mbox\fi%
+ \mybox{%
+ \begin{minipage}[b]{5em}%
+ \baselineskip=\dimexpr\baselineskip*10/15\relax%
+ \centering{#2}%
+ \end{minipage}%
+ }%
+}
+
+\NewDocumentCommand{\idef}{O{\ftbiological}mO{0}moO{0pt}}{%
+ % [cmark] id [fbox] name [opt] [xlen]
+ \indvdldef[#1]{#2}{\cname[#3]{#4}}[#5][#6]%
+}
+
+\begin{document}
+%\pagestyle{empty}
+
+familytree pkg sample
+
+\section*{\textsl{Inheritance Diagram}}
+
+Here, the Crawley family and their stories are borrowed from the
+famous British TV series \textsl{Downton Abbey\,.}
+I've borrowed it just to show how to use this familytree package.
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section*{Crawley sisters}
+
+\idef{youngSybil}{Lady Sybil}
+\idef{youngEdith}{Lady Edith}
+\idef{youngMary}{Lady Mary}
+\sblngdef{youngSis}{youngMary,ivali,youngEdith,ivali,youngSybil}
+
+\idef{Robert}[1]{Robert Crawley}[7th Earl of Grantham]
+\idef[\ftblank]{Cora}{Cora Crawley \nee{Levinson}}[Countess of
+ Grantham,\haschild]
+\mrrgdef{seven}{}{Robert}{Cora}
+
+\gensdef{RobertyoungSis}{seven}{%
+ {Cora}{youngSis}%
+}
+\fbox{\usebox{\RobertyoungSis}}
+\bigskip
+
+Under the fee tail or ``entail'', three daughters
+cannot inherit the title and the estate of Lord Grantham's,
+including the big amount of fortune (dowry) Cora had brought.
+The law requires a male heir.
+
+Fortunately Robert has a cousin James Crawley, and his son Patrick.
+They are good heir presumptive to the earldom.
+Actually, but not officially, the eldest daughter Lady Mary is engaged
+to Patrick so that the family will keep their assets.
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section*{Relationship between Robert, Matthew and cousin Patrick}
+\small
+
+\idef{youngMatthew}[1]{Matthew Crawley}
+\idef{Patrick}[1]{Patrick Crawley}[deceased\,?]
+
+\idef{Reginald}{Dr. Reginald Crawley}[(deceased)]
+\idef[\ftblank]{Isobel}{Isobel Crawley \nee{Turnbull}}[\haschild]
+\mrrgdef{ReginaldIsobel}{}{Reginald}{Isobel}[3em]
+\gensdef{IsobelMatthew}{ReginaldIsobel}{%
+ {Isobel}{youngMatthew}%
+}
+
+\ftundef{Robert}
+\idef{Robert}[1]{Robert Crawley}[7th Earl of Grantham,\maleline][2em]
+\pcdef{RobertMary}{Robert}{youngMary}
+
+\idef{James}[1]{James Crawley}[(deceased),\maleline][2em]
+\pcdef{JamesPatrick}{James}{Patrick}
+
+% \fbox{\vbox{%
+% \hbox{\usebox{\IsobelMatthew}}%
+% \vskip\baselineskip%
+% \hbox{\usebox{\RobertMary}}%
+% \vskip\baselineskip%
+% \hbox{\usebox{\JamesPatrick}}%
+% }}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\idef{sixMat}{{\relsize{-1} Mr. Crawley}}
+ [6th gen.,(deceased),\maleline][3em]
+\pcdef{sixMatpc}{sixMat}{IsobelMatthew}
+
+\idef{PatrickSix}{Patrick Crawley}
+ [6th Earl of Grantham,(deceased),\maleline][3em]
+\pcdef{sixRobpc}{PatrickSix}{RobertMary}
+
+\pcdef{sixPatpc}{sixMat}{JamesPatrick}
+
+\sblngdef{sixes}{sixRobpc,ival,sixPatpc}
+
+% \fbox{\vbox{
+% \hbox{\usebox{\sixMatpc}}
+% \vskip\baselineskip
+% \hbox{\usebox{\sixes}}
+% }}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\idef{fiveMat}{{\relsize{-1} Mr. Crawley}}[5th gen.,(deceased),\maleline]
+\pcdef{fiveMatpc}{fiveMat}{sixMatpc}
+
+\idef{fiveRob}{{\relsize{-1} 5th Earl of Grantham}}[(deceased),\maleline]
+\pcdef{fiveRobpc}{fiveRob}{sixes}
+
+% \fbox{\vbox{%
+% \hbox{\usebox{\fiveMatpc}}%
+% \vskip\baselineskip%
+% \hbox{\usebox{\fiveRobpc}}%
+% }}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\idef{fourMat}{{\relsize{-1} Mr. Crawley}}[4th gen.,(deceased),\maleline]
+\pcdef{fourMatpc}{fourMat}{fiveMatpc}
+\idef{fourRob}{{\relsize{-1} 4th Earl of Grantham}}[(deceased),\maleline]
+\pcdef{fourRobpc}{fourRob}{fiveRobpc}
+
+\sblngdef{fours}{fourRobpc,ival,fourMatpc}
+
+% \fbox{\usebox{\fours}}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\idef[\fttop]{three}{{\relsize{-1} 3rd Earl of Grantham}}[(deceased),\maleline]
+\pcdef{threepc}{three}{fours}
+
+\fbox{\usebox{\threepc}}
+\bigskip
+
+\normalsize
+In 1912, James and Patrick have perished in the sinking of Titanic,
+and their body were not found. Not only Lady Mary lost her unofficial
+fianc\'{e}, but also the family lost the male heir.
+
+But Murray, Lord Grantham's business partner also a lawyer, discovered
+Robert's third cousin once removed, Matthew Crawley who is a son of an
+upper-middle-class doctor.
+Now Matthew has become the next heir presumptive out of the blue.
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section*{Family member of Robert Crawley}
+
+\idef{Sybbie}{Sybil ``Sybbie'' Branson}
+\idef[\ftblank]{Tom}{Tom Branson}[\haschild]
+\idef{Sybil}{Sybil Cora Branson \nee{Crawley}}[(deceased)]
+
+\idef{Marigold}{Marigold Crawley}
+\idef{Edith}{Edith Pelham \nee{Crawley}}[Marchioness of Hexham]
+\idef[\ftblank]{Bertie}{Herbert ``Bertie'' Pelham}[7th Marquess of Hexham]
+\idef[\ftblank]{Gregson}{Michael Gregson}[(deceased),\private,\haschild]
+
+\idef{George}[1]{George Crawley}[Heir presumptive of,Robert Crawley]
+\idef[\ftblank]{Matthew}{Matthew Crawley}[(deceased),\haschild]
+\idef{Mary}{Mary Josephine Crawley}%[ ]
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\mrrgdef{Bransons}{Tom}{Sybil}{}[\dimexpr\wd\Bertie-\wd\Sybil-2em\relax]
+\gensdef{TomSybbie}{Bransons}{%
+ {Tom}{Sybbie}%
+}
+% \fbox{\usebox{\TomSybbie}}
+
+\mrrgdef{EdithHus}{Gregson}{Edith}{Bertie}[-2em]
+\gensdef{EdithMarigold}{EdithHus}{%
+ {Gregson}{Marigold}%
+}
+% \fbox{\usebox{\EdithMarigold}}
+
+\mrrgdef{MatthewMary}{Matthew}{Mary}{}
+ [\dimexpr\wd\Bertie-\wd\Matthew-2em\relax]
+\gensdef{MaryGeorge}{MatthewMary}{%
+ {Matthew}{George}%
+}
+% \fbox{\usebox{\MaryGeorge}}
+
+\sblngdef{sis}{MaryGeorge,ivalii,EdithMarigold,ivalii,TomSybbie}
+% \fbox{\usebox{\sis}}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\idef{Rosamund}{Rosamund Painswick \nee{Crawley}}
+\hyphenation{Marmaduke}
+\idef[\ftblank]{Marmaduke}{Sir Marmaduke Painswick}[(deceased)]
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\mrrgdef{Painswicks}{}{Rosamund}{Marmaduke}
+\sblngdef{RobertRosamund}{seven,ivalii,Painswicks}
+% \fbox{\usebox{\RobertRosamund}}
+
+\edef\RobertRosamundsevennameCY{%
+ \stript\dimexpr\sevenCoramrrgCY pt + \RobertRosamundsevennameCY pt%
+ - \sevennameCY pt%
+}
+\gensdef{Robertandsis}{RobertRosamund}{%
+ {seven}{sis}%
+}
+% \fbox{\usebox{\Robertandsis}}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\ftundef{PatrickSix}
+\idef{PatrickSix}{Patrick Crawley}[6th Earl of Grantham (deceased)]
+\idef[\ftblank]{Violet}{Violet Crawley}
+ [Dowager Countess of Grantham,\haschild]
+
+\mrrgdef{six}{}{PatrickSix}{Violet}
+\gensdef{Crawleys}{six}{%
+ {Violet}{Robertandsis}%
+}
+
+\fbox{\usebox{\Crawleys}}
+
+\hfill (at the end of Season 7)
+
+\end{document}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\idef[\ftblank]{}{Isidore Levinson}[(deceased)]
+\idef{}{Martha Levinson}
+\mrrgdef{Levinsons}{}{Isidore}{Martha}
+\idef{}{Harold Levinson}
+
+\idef{}{Roberta}
+\idef[\ftblank]{}{husband}
+
+\idef{}{Susan MacClare}[Marchioness of Flintshire]
+\idef[\ftblank]{}{Hugh ``Shrimpie'' MacClare}[Marquess of Flintshire]
+\mrrgdef{MacClares}{}{Shrimpie}{Susan}
+\idef{}{Lady Rose MacClare}
diff --git a/macros/latex/contrib/familytree/samples/Makefile b/macros/latex/contrib/familytree/samples/Makefile
new file mode 100644
index 0000000000..61db41cab8
--- /dev/null
+++ b/macros/latex/contrib/familytree/samples/Makefile
@@ -0,0 +1,24 @@
+
+Dir ?= /tmp
+Tgt = ${Dir}/Crawley.pdf
+
+include ../cmd.mk
+
+all: ${Tgt}
+ for i in Asai Tokugawa; \
+ do ${MAKE} -C ${CURDIR}/$${i} $@; done
+
+clean:
+ ${RM} *~ ${Tgt}
+ for i in Asai Tokugawa; \
+ do ${MAKE} -C ${CURDIR}/$${i} $@; done
+
+install: all
+ install -m 444 -pD ${Tgt} \
+ ${InstallDir}/source/latex/${Name}/$(notdir ${Tgt})
+ for i in Asai Tokugawa; \
+ do ${MAKE} -C ${CURDIR}/$${i} $@; done
+
+${Tgt}: ${Dir}/%.pdf: %.tex ${Dir}/familytree.sty
+ $(call Latex, $<)
+ cd ${Dir}; ${DVIPDFMX} $(basename $<).dvi
diff --git a/macros/latex/contrib/familytree/samples/Tokugawa.pdf b/macros/latex/contrib/familytree/samples/Tokugawa.pdf
new file mode 100644
index 0000000000..78b07ad266
--- /dev/null
+++ b/macros/latex/contrib/familytree/samples/Tokugawa.pdf
Binary files differ
diff --git a/macros/latex/contrib/familytree/samples/Tokugawa/Makefile b/macros/latex/contrib/familytree/samples/Tokugawa/Makefile
new file mode 100644
index 0000000000..9c91482b6f
--- /dev/null
+++ b/macros/latex/contrib/familytree/samples/Tokugawa/Makefile
@@ -0,0 +1,20 @@
+
+Dir ?= /tmp
+Tgt = ${Dir}/Tokugawa.pdf
+
+LATEX ?= platex -kanji=euc
+include ../../cmd.mk
+
+all: ${Tgt}
+
+clean:
+ ${RM} *~ ${Tgt}
+
+install:
+ install -m 444 -pD ${Tgt} \
+ ${InstallDir}/source/latex/${Name}/$(notdir ${Tgt})
+
+${Tgt}: ${Dir}/%.pdf: %.tex ${Dir}/familytree.sty
+ $(call Latex, $<)
+ cd ${Dir}; ${DVIPDFMX} -o a.pdf $(basename $<).dvi
+ ${PDFCROP} ${Dir}/a.pdf $@
diff --git a/macros/latex/contrib/familytree/samples/Tokugawa/Tokugawa.tex b/macros/latex/contrib/familytree/samples/Tokugawa/Tokugawa.tex
new file mode 100644
index 0000000000..dd71aa8e28
--- /dev/null
+++ b/macros/latex/contrib/familytree/samples/Tokugawa/Tokugawa.tex
@@ -0,0 +1,299 @@
+\documentclass[
+ paper=a0,
+ tate,
+ %landscape,
+ %12pt,
+ jlreq_notes,open_bracket_pos=nibu_tentsuki
+]{jlreq}
+\AtBeginDvi{\special{papersize=\the\paperwidth,\the\paperheight}}
+
+\input{../../fonts}
+\usepackage[noreplace,expert]{otf}
+\usepackage{familytree}
+
+\newcommand{\Empty}{}
+\newcommand{\nm}{}
+\NewDocumentCommand{\idef}{O{\ftbiological}momoO{0pt}}{
+ % [cmark] xname [title] name [opt] [xlen]
+ \def\nm{#4}%
+ \if#2\Empty\else%
+ \def\nm{#4(#2)}%
+ \fi%
+ %
+ \indvdldef[#1]{#4}[#3]{\nm}[#5][#6]%
+}
+\let\sdef=\sblngdef
+%\nameboxcfg{}{}{}{4zw}
+
+\ivaldef{ivalv}{5zh}
+\ivaldef{ivalx}{10zh}
+
+\begin{document}
+\pagestyle{empty}
+
+familytree sample
+
+\textgt{\large 徳川将軍父系図}
+
+\input{tg-15th}
+% \fbox{\usebox{\家茂の子}}
+
+\input{tg-14th}
+\pcdef{家茂慶喜}{家茂}{家茂の子}
+% \fbox{\usebox{\家茂慶喜}}
+
+\input{tg-13th}
+\gensdef{家定家茂}{家慶の子}{%
+ {家定}{家茂慶喜}%
+}
+% \fbox{\usebox{\家定家茂}}
+
+\input{tg-12th}
+\gensdef{家慶家定}{家斉の子}{%
+ {家慶}{家定家茂},%
+ {斉順}{慶福}%
+}
+% \fbox{\usebox{\家慶家定}}
+
+\input{tg-11th}
+%\ftdbgtrue
+%\message{\the\ht\家慶家定}
+\gensdef{家斉家慶}{家治の子}{%
+ {家斉}{家慶家定}%
+}
+%\message{\the\ht\家斉家慶}
+% \fbox{\usebox{\家斉家慶}}
+
+\input{tg-10th}
+\gensdef{家治家斉}{家重の子}{%
+ {家治}{家斉家慶}%
+}
+\gensdef{治済親子}{宗尹の子}{%
+ {治済}{治済の子}%
+}
+% \fbox{%
+% \vbox{\hbox{\usebox{\家治家斉}}%
+% \vskip\baselineskip%
+% \hbox{\usebox{\治済親子}}%
+% \vskip\baselineskip%
+% \hbox{\usebox{\斉昭の子}}%
+% }}
+
+\input{tg-9th}
+\gensdef{家重家治}{吉宗の子}{%
+ {家重}{家治家斉},%
+ {宗尹}{治済親子}%
+}
+%\sdef{頼学の子}{頼英,松平頼久}
+\gensdef{斉昭親子}{治紀の子}{%
+ {斉昭}{斉昭の子}%
+}
+% \fbox{%
+% \vbox{\hbox{\usebox{\家重家治}}%
+% \vskip\baselineskip%
+% \hbox{\usebox{\斉昭親子}}%
+% }}
+
+\input{tg-8th}
+\pcdef{吉宗家重}{吉宗}{家重家治}
+\pcdef{頼学親子}{頼学}{頼学の子}
+%\pcdef{頼啓親子}{頼啓}{頼学}
+\gensdef{治紀斉昭}{治保の子}{%
+ {治紀}{斉昭親子}%
+}
+% \fbox{%
+% \vbox{\hbox{\usebox{\吉宗家重}}%
+% \vskip\baselineskip%
+% \hbox{\usebox{\頼学親子}}%
+% \vskip\baselineskip%
+% \hbox{\usebox{\治紀斉昭}}%
+% }}
+
+\input{tg-7th}
+\pcdef{家継吉宗}{家継}{吉宗家重}
+\gensdef{頼啓頼学}{頼謙の子}{%
+ {頼啓}{頼学親子}%
+}
+\gensdef{治保治紀}{宗翰の子}{%
+ {治保}{治紀斉昭}%
+}
+% \fbox{%
+% \vbox{\hbox{\usebox{\家継吉宗}}%
+% \vskip\baselineskip%
+% \hbox{\usebox{\頼啓頼学}}%
+% \vskip\baselineskip%
+% \hbox{\usebox{\治保治紀}}%
+% }}
+
+\input{tg-6th}
+\pcdef{家宣家継}{家宣}{家継吉宗}
+\gensdef{頼謙頼啓}{宗将の子}{%
+ {頼謙}{頼啓頼学}%
+}
+%\sdef{頼豊の子}{軽麻呂,頼治}
+\gensdef{宗翰治保}{宗堯の子}{%
+ {宗翰}{治保治紀}%
+}
+% \fbox{\usebox{\宗将の子}}\par
+% \fbox{\usebox{\頼豊の子}}\par
+% \fbox{\usebox{\宗堯の子}}\par
+% \fbox{%
+% \vbox{\hbox{\usebox{\家宣家継}}%
+% \vskip\baselineskip%
+% \hbox{\usebox{\頼謙頼啓}}%
+% \vskip\baselineskip%
+% \hbox{\usebox{\宗翰治保}}%
+% }}
+
+\input{tg-5th}
+\pcdef{綱吉家宣}{綱吉}{家宣家継}
+\gensdef{宗将頼謙}{宗直の子}{%
+ {宗将}{頼謙頼啓}%
+}
+%\tokuone{頼章}{式部}
+\gensdef{頼豊親子}{頼常の子}{%
+ {頼豊}{頼豊の子}%
+}
+\gensdef{宗堯宗翰}{綱条の子}{%
+ {宗堯}{宗翰治保}%
+}
+% \fbox{\usebox{\綱吉}}\par
+% \fbox{\usebox{\宗直の子}}\par
+% \fbox{\usebox{\頼常の子}}\par
+% \fbox{\usebox{\綱条の子}}\par
+% \fbox{%
+% \vbox{\hbox{\usebox{\綱吉家宣}}%
+% \vskip\baselineskip%
+% \hbox{\usebox{\宗将頼謙}}%
+% \vskip\baselineskip%
+% \hbox{\usebox{\頼豊親子}}%
+% \vskip\baselineskip%
+% \hbox{\usebox{\宗堯宗翰}}%
+% }}
+
+\input{tg-4th}
+\gensdef{家綱綱吉}{家光の子}{%
+ {家綱}{綱吉家宣},%
+ {綱重}{綱重の子}%
+}
+%\sdef{光貞の子}{綱教,頼職,頼久}
+\gensdef{宗直宗将}{頼純の子}{%
+ {宗直}{宗将頼謙}%
+}
+\gensdef{頼常頼豊}{頼重の子}{%
+ {頼常}{頼豊親子},%
+ {頼章}{式部}%
+}
+%\let\頼章頼豊=\頼常頼豊
+\gensdef{綱条宗堯}{光圀の子}{%
+ {綱条}{宗堯宗翰}%
+}
+% \fbox{\usebox{\家光の子}}\par
+% \fbox{\usebox{\光貞の子}}\par
+% \fbox{\usebox{\頼純の子}}\par
+% \fbox{\usebox{\頼重の子}}\par
+% \fbox{\usebox{\光圀の子}}\par
+% \fbox{%
+% \vbox{\hbox{\usebox{\家綱綱吉}}%
+% \vskip\baselineskip%
+% \hbox{\usebox{\宗直宗将}}%
+% \vskip\baselineskip%
+% \hbox{\usebox{\頼常頼豊}}%
+% \vskip\baselineskip%
+% \hbox{\usebox{\綱条宗堯}}%
+% }}
+
+\input{tg-3rd}
+\gensdef{家光家綱}{秀忠の子}{%
+ {家光}{家綱綱吉}%
+}
+\gensdef{光貞頼久}{頼宣の子}{%
+ {光貞}{光貞の子},%
+ {頼純}{宗直宗将}%
+}
+%\let\頼純宗直=\光貞頼久
+\gensdef{頼重頼常}{頼房の子}{%
+ {頼重}{頼常頼豊},%
+ {光圀}{綱条宗堯}%
+}
+\let\光圀綱条=\頼重頼常
+% \fbox{%
+% \vbox{\hbox{\usebox{\家光家綱}}%
+% \vskip\baselineskip%
+% \hbox{\usebox{\光貞頼久}}%
+% \vskip\baselineskip%
+% \hbox{\usebox{\頼重頼常}}%
+% }}
+
+\input{tg-2nd}
+\gensdef{秀忠家光}{家康の子}{%
+ {秀忠}{家光家綱},%
+ {頼宣}{光貞頼久},%
+ {頼房}{頼重頼常}%
+}
+% \fbox{\usebox{\秀忠家光}}
+
+\input{tg-1st}
+\pcdef{家康秀忠}{家康}{秀忠家光}
+%\fbox{%
+\usebox{\家康秀忠}%
+%}
+
+% W \the\wd\家康秀忠, H \the\ht\家康秀忠, D \the\dp\家康秀忠
+
+\clearpage
+\begin{minipage}{16zw}
+\iffalse
+天皇家は皇位継承の際に養子をとることはない。条件は皇族男子ということし
+かないのだろうか。
+一方、将軍家は必ず養子にして将軍職を継がせている。この
+違いは何だろうかと自分なりに考えてみた。
+
+将軍家の場合は、「職」を継いでいるという点が意味を持つのだろうか。
+財産の相続だけならば養子でなくとも良いと思うが、昔は考え方が違うのだろ
+うか。
+うーん、どうだろう。
+
+職イコール官位は朝廷から賜わったもので、これを継承できるのは嫡男に限る
+とかいうことか。んで、職イコール「家」か。
+古くは「大蔵」という職があり、その職を同じ家で継承していたそうな。その
+名も大蔵さん。職の大蔵は後の大蔵省につながる。仕事の中身が蔵の管理かお
+金の管理かは知らんけど。
+
+継承できなければ返上(奉還)するしかないということか。
+だから随分遠い親戚でも優秀と見込まれれば将軍職にふさわしいとの考えから、
+たとえ折り合いが悪い者でも、養子の方が年上でも、
+養子縁組して将軍職を継がせるということなのか。
+うーん、違うかな。
+
+でも、優秀かどうかという判断が入るのは養子の場合だけで、実子がある場合
+は幼少とか病弱とか、あまり良くない状況でも継いでいる。実子というだけで
+相当強いようだ。
+開国前後の幕府の無能ぶりはよく言われるが、全く考えていないわけではない。
+将軍職の継承はおおごとだからかもしれないけど、意外と考えているじゃない
+かという印象だ。
+
+尾張、水戸、紀伊は御三家といって、家康の子が徳川分家になった。当初か
+ら宗家の跡継ぎがピンチになった場合のバックアップと考えられていたようだ。
+権力闘争を避ける目的もあっただろうが。
+このバックアップは有効に機能した。尾張、水戸は後に宗家へ養子を送り出した。
+尾張から将軍は出ていないが、意義が無いわけではない。
+
+現代の皇室はどうだろうか。
+明治政府が典侍などの女官職を大きく変更し、大正時代にも当時の摂政が典侍
+をいよいよ廃止する方向へ進めた。
+大正天皇以降、天皇は皇后としか子をもうけていない。側室制度もない。
+現在の皇室典範では正室の子しか皇族ではないとしているらしい。
+うーん、バックアップは要らんのだろうか?
+\bigskip
+
+水戸黄門は実子を長兄へ養子に出し、また長兄の子を養子にとったりしている。
+なんか不自然に見えるが、次男の自分が家督を継いだことに引け目を感じてい
+たからだそうな。次代は兄の子へ継がせたかったということか。
+\bigskip
+\fi
+
+この図は単に人数が多いだけではなく、代を同じ高さに揃えるのに手間がかかっ
+た。この辺もfamilytree pkgの今後の課題だ、優先度は低いけれども。
+\end{minipage}
+\end{document}
diff --git a/macros/latex/contrib/familytree/samples/Tokugawa/tg-10th.tex b/macros/latex/contrib/familytree/samples/Tokugawa/tg-10th.tex
new file mode 100644
index 0000000000..b58df406e3
--- /dev/null
+++ b/macros/latex/contrib/familytree/samples/Tokugawa/tg-10th.tex
@@ -0,0 +1,25 @@
+\idef{}[十代]{家治}[\ftmaleline,生\ymd{1737}][4zw]
+\idef{清水}{重好}
+\sdef{家重の子}{家治,重好}
+
+\idef{松平}{重昌}
+\idef{松平}{重富}
+\idef{}{治済}[\ftmaleline][4zw]
+\idef{黒田}{治之}
+\sdef{宗尹の子}{重昌,重富,治済,治之}
+
+\idef{}{慶篤}[生\ymd{1832}]
+\idef{池田}{慶徳}
+\idef{松平 一橋 後の十五代 慶喜}{昭致}
+\idef{松平}{直侯}
+\idef{池田}{茂政}
+\idef{松平}{武聰}
+\idef{喜連川}{縄氏}
+\idef{松平}{昭訓}
+%\idef{松平}{忠和}
+\indvdldef{斉昭子忠和}{忠和(松平)}
+\idef{土屋}{挙直}
+\idef{徳川}{昭武}
+\idef{松平}{喜徳}
+\idef{松平}{頼之}[生\ymd{1858}]
+\sdef{斉昭の子}{慶篤,慶徳,昭致,直侯,茂政,武聰,縄氏,昭訓,斉昭子忠和,挙直,昭武,喜徳,頼之}
diff --git a/macros/latex/contrib/familytree/samples/Tokugawa/tg-11th.tex b/macros/latex/contrib/familytree/samples/Tokugawa/tg-11th.tex
new file mode 100644
index 0000000000..635339f898
--- /dev/null
+++ b/macros/latex/contrib/familytree/samples/Tokugawa/tg-11th.tex
@@ -0,0 +1,11 @@
+\idef[\adopted]{}[十一代]{家斉}[\ftmaleline,生\ymd{1773}][10zw]
+\idef{}{家基}
+\sdef{家治の子}{家基,ival,家斉}
+
+\idef{後の十一代 家斉}{豊千代}
+\idef{}{治国}
+\idef{黒田}{斉隆}
+\idef{}{斉匡}
+\idef{}{斉敦}
+\idef{松平}{義居}
+\sdef{治済の子}{豊千代,治国,斉隆,斉匡,斉敦,義居}
diff --git a/macros/latex/contrib/familytree/samples/Tokugawa/tg-12th.tex b/macros/latex/contrib/familytree/samples/Tokugawa/tg-12th.tex
new file mode 100644
index 0000000000..7468787721
--- /dev/null
+++ b/macros/latex/contrib/familytree/samples/Tokugawa/tg-12th.tex
@@ -0,0 +1,14 @@
+\idef{}[十二代]{家慶}[\ftmaleline,生\ymd{1793}][4zw]
+\idef{}{斉順}[\ftmaleline,なりゆき]
+\idef{清水}{斉明}
+\idef{}{斉荘}%[なりたか]
+\idef{池田}{斉衆}
+\idef{松平}{斉民}
+\idef{尾張}{斉温}%[なりはる]
+\idef{松平}{斉良}%[なりなが]
+\idef{}{斉彊}%[なりかつ]
+\idef{松平}{斉善}%[なりさわ]
+\idef{蜂須賀}{斉裕}%[なりひろ]
+\idef{松平}{斉省}%[なりさだ]
+\idef{松平}{斉宣}[生\ymd{1825}]
+\sdef{家斉の子}{家慶,ival,斉順,斉明,斉荘,斉衆,斉民,斉温,斉良,斉彊,斉善,斉裕,斉省,斉宣}
diff --git a/macros/latex/contrib/familytree/samples/Tokugawa/tg-13th.tex b/macros/latex/contrib/familytree/samples/Tokugawa/tg-13th.tex
new file mode 100644
index 0000000000..c51f640176
--- /dev/null
+++ b/macros/latex/contrib/familytree/samples/Tokugawa/tg-13th.tex
@@ -0,0 +1,6 @@
+\idef{}[十三代]{家定}[生\ymd{1824},\ftmaleline][4zw]
+\idef{一橋}{慶昌}
+\sdef{家慶の子}{家定,ival,慶昌}
+
+\idef{後の十四代 家茂}{慶福}
+%\tokuone{斉順}{慶福}
diff --git a/macros/latex/contrib/familytree/samples/Tokugawa/tg-14th.tex b/macros/latex/contrib/familytree/samples/Tokugawa/tg-14th.tex
new file mode 100644
index 0000000000..54b864dbc9
--- /dev/null
+++ b/macros/latex/contrib/familytree/samples/Tokugawa/tg-14th.tex
@@ -0,0 +1 @@
+\idef[\adopted]{}[十四代]{家茂}[\ftmaleline,生\ymd{1846}][2zw]
diff --git a/macros/latex/contrib/familytree/samples/Tokugawa/tg-15th.tex b/macros/latex/contrib/familytree/samples/Tokugawa/tg-15th.tex
new file mode 100644
index 0000000000..1554a8a8bf
--- /dev/null
+++ b/macros/latex/contrib/familytree/samples/Tokugawa/tg-15th.tex
@@ -0,0 +1,3 @@
+\idef[\adopted]{}{茂承}[もちつぐ]
+\idef[\adopted]{}[十五代]{慶喜}[生\ymd{1837}]
+\sdef{家茂の子}{茂承,ival,慶喜}
diff --git a/macros/latex/contrib/familytree/samples/Tokugawa/tg-1st.tex b/macros/latex/contrib/familytree/samples/Tokugawa/tg-1st.tex
new file mode 100644
index 0000000000..a04add5312
--- /dev/null
+++ b/macros/latex/contrib/familytree/samples/Tokugawa/tg-1st.tex
@@ -0,0 +1 @@
+\idef[\fttop]{}[初代]{家康}[\ftmaleline,生\ymd{1543}]
diff --git a/macros/latex/contrib/familytree/samples/Tokugawa/tg-2nd.tex b/macros/latex/contrib/familytree/samples/Tokugawa/tg-2nd.tex
new file mode 100644
index 0000000000..5b47172236
--- /dev/null
+++ b/macros/latex/contrib/familytree/samples/Tokugawa/tg-2nd.tex
@@ -0,0 +1,10 @@
+\idef{松平}{信康}
+\idef{結城}{秀康}
+\idef{}[二代]{秀忠}[\ftmaleline,生\ymd{1579}][4zw]
+\idef{松平}{忠吉}
+\idef{武田}{信吉}
+\idef{松平}{忠輝}
+\idef{尾張}{義直}
+\idef{紀伊}{頼宣}[\ftmaleline]
+\idef{水戸}{頼房}[\ftmaleline]
+\sdef{家康の子}{信康,秀康,ival,秀忠,ival,忠吉,信吉,忠輝,義直,ival,頼宣,ivalx,ivalx,ivalv,ivali,頼房}
diff --git a/macros/latex/contrib/familytree/samples/Tokugawa/tg-3rd.tex b/macros/latex/contrib/familytree/samples/Tokugawa/tg-3rd.tex
new file mode 100644
index 0000000000..032ab8599f
--- /dev/null
+++ b/macros/latex/contrib/familytree/samples/Tokugawa/tg-3rd.tex
@@ -0,0 +1,22 @@
+\idef{}[三代]{家光}[\ftmaleline,生\ymd{1604}][4zw]
+\idef{駿河}{忠長}
+\idef{保科}{正之}
+\sdef{秀忠の子}{家光,忠長,正之}
+
+\idef{}{光貞}[\ftmaleline][4zw]
+\idef{松平}{修理}
+\idef{松平}{頼純}[\ftmaleline]
+\sdef{頼宣の子}{光貞,ivalii,修理,ivalii,頼純}
+
+\idef{松平}{頼重}[\ftmaleline,生\ymd{1622}]
+\idef{}{光圀}[\ftmaleline][4zw]
+\idef{松平}{頼元}
+\idef{松平}{頼隆}
+\idef{松平}{頼利}
+\idef{松平}{頼雄}
+\indvdldef{頼房子頼雄}{頼雄(松平)}
+\indvdldef{頼房子頼泰}{頼泰(松平)}
+\idef{松平}{頼以}
+\idef{松平}{房時}
+\idef{鈴木}{重義}[生\ymd{1634}]
+\sdef{頼房の子}{頼重,ivalii,ivalii,光圀,頼元,頼隆,頼利,頼房子頼雄,頼房子頼泰,頼以,房時,重義}
diff --git a/macros/latex/contrib/familytree/samples/Tokugawa/tg-4th.tex b/macros/latex/contrib/familytree/samples/Tokugawa/tg-4th.tex
new file mode 100644
index 0000000000..033c12f4cd
--- /dev/null
+++ b/macros/latex/contrib/familytree/samples/Tokugawa/tg-4th.tex
@@ -0,0 +1,35 @@
+
+\idef{}[四代]{家綱}[\ftmaleline,生\ymd{1641}][8zw]
+\idef{甲府}{綱重}[\ftmaleline]
+\idef{後の五代 綱吉}{徳松}
+\sdef{家光の子}{家綱,ival,綱重,徳松}
+
+\idef{}{綱教}
+\idef{}{頼職}
+\idef{後の八代 吉宗}{頼久}
+\sdef{光貞の子}{綱教,頼職,頼久}
+
+\idef{渡辺}{恭綱}
+\idef{松平}{頼路}
+\idef{松平}{頼廉}
+\indvdldef{頼純子頼雄}{頼雄(松平)}
+\idef{}{宗直}[\ftmaleline][8zw]
+\idef{三堀}{尚峯}
+\idef{松平}{頼渡}
+\sdef{頼純の子}{恭綱,頼路,頼廉,頼純子頼雄,宗直,尚峯,頼渡}
+
+\idef{後の徳川綱方}{頼世}%[よりよ]%光圀へ
+\idef[\adopted]{}{頼常}[\ftmaleline][8zw]
+\idef{後の徳川綱条}{頼国}%光圀へ
+\idef{}{頼剛}
+\idef{}{頼章}[\ftmaleline]
+\idef{}{頼直}
+\idef{}{頼芳}
+\sdef{頼重の子}{頼世,頼常,頼国,頼剛,頼章,頼直,頼芳}
+
+%光圀の実子
+\idef{後の松平頼常}{鶴千代}%頼重へ
+%光圀の養子
+\idef[\adopted]{}{綱方}
+\idef[\adopted]{}{綱条}[\ftmaleline,綱條 つなえだ][8zw]
+\sdef{光圀の子}{鶴千代,綱方,綱条}
diff --git a/macros/latex/contrib/familytree/samples/Tokugawa/tg-5th.tex b/macros/latex/contrib/familytree/samples/Tokugawa/tg-5th.tex
new file mode 100644
index 0000000000..180ab0d48c
--- /dev/null
+++ b/macros/latex/contrib/familytree/samples/Tokugawa/tg-5th.tex
@@ -0,0 +1,27 @@
+
+\idef[\adopted]{}[五代]{綱吉}[\ftmaleline,生\ymd{1646}][4zw]
+
+\idef{後の六代 家宣}{綱豊}
+\idef{松平}{清武}
+\sdef{綱重の子}{綱豊,清武}
+
+\idef{}{宗将}[\ftmaleline][4zw]
+\idef{}{治貞}
+\idef{松平}{頼央}
+\idef{松平}{信有}
+\idef{内藤}{貞幹}
+\sdef{宗直の子}{宗将,治貞,頼央,信有,貞幹}
+
+\idef{後の頼豊}{式部}
+%\tokuone{頼章}{式部}
+
+\indvdldef{頼常子頼泰}{頼泰}
+\idef{}{久松}
+\idef[\adopted]{}{頼豊}[\ftmaleline][4zw]
+\sdef{頼常の子}{頼常子頼泰,久松,頼豊}
+
+\idef{}{吉孚}[よしざね]
+\indvdldef[\adopted]{tmp}{宗堯}[\ftmaleline,むねたか]
+\idef[\adopted]{}{宗堯}[\ftmaleline,むねたか][4zw]
+\ftundef{tmp}
+\sdef{綱条の子}{吉孚,宗堯}
diff --git a/macros/latex/contrib/familytree/samples/Tokugawa/tg-6th.tex b/macros/latex/contrib/familytree/samples/Tokugawa/tg-6th.tex
new file mode 100644
index 0000000000..d3b9484d97
--- /dev/null
+++ b/macros/latex/contrib/familytree/samples/Tokugawa/tg-6th.tex
@@ -0,0 +1,21 @@
+\idef[\adopted]{}[六代]{家宣}[\ftmaleline,生\ymd{1662}][4zw]
+
+\idef{}{重倫}
+\idef{内藤}{学文}
+\idef{松平}{頼興}
+\idef{松平}{頼謙}[\ftmaleline,よりかた]
+\idef{松平}{忠功}
+\idef{三浦}{為脩}
+%\idef{松平}{忠和}
+\indvdldef{宗将子忠和}{忠和(松平)}
+\idef{安藤}{道紀}
+\idef{阿部}{正由}
+\sdef{宗将の子}{重倫,学文,頼興,頼謙,忠功,為脩,宗将子忠和,道紀,正由}
+
+\idef{後の徳川宗堯}{軽麻呂}%綱條へ
+\idef{}{頼治}
+\sdef{頼豊の子}{軽麻呂,頼治}
+
+\idef{松平}{頼順}%[よりゆき]
+\idef{}{宗翰}[\ftmaleline,むねもと][4zw]
+\sdef{宗堯の子}{頼順,宗翰}
diff --git a/macros/latex/contrib/familytree/samples/Tokugawa/tg-7th.tex b/macros/latex/contrib/familytree/samples/Tokugawa/tg-7th.tex
new file mode 100644
index 0000000000..6172b42760
--- /dev/null
+++ b/macros/latex/contrib/familytree/samples/Tokugawa/tg-7th.tex
@@ -0,0 +1,14 @@
+\idef{}[七代]{家継}[\ftmaleline,生\ymd{1709}][4zw]
+
+\idef{松平}{頼看}
+\idef{本多}{忠顕}
+\idef{松平}{頼啓}[\ftmaleline,よりゆき]
+\sdef{頼謙の子}{頼看,忠顕,頼啓}
+
+\idef{}{治保}[\ftmaleline][4zw]
+\idef{松平}{頼図}%松平頼順養子
+\idef{松平}{頼救}
+\idef{松平}{保受}
+\idef{松平}{保福}%松平頼脩養子
+\idef{中山}{信敬}%中山政信養子
+\sdef{宗翰の子}{治保,頼図,頼救,保受,保福,信敬}
diff --git a/macros/latex/contrib/familytree/samples/Tokugawa/tg-8th.tex b/macros/latex/contrib/familytree/samples/Tokugawa/tg-8th.tex
new file mode 100644
index 0000000000..f65ce053fd
--- /dev/null
+++ b/macros/latex/contrib/familytree/samples/Tokugawa/tg-8th.tex
@@ -0,0 +1,9 @@
+\idef[\adopted]{}[八代]{吉宗}[\ftmaleline,生\ymd{1684}][4zw]
+
+\idef{松平}{頼学}[\ftmaleline,よりさと]
+%\tokuone{頼啓}{頼学}
+
+\idef{}{治紀}[\ftmaleline][4zw]
+\idef{松平}{義和}
+\idef{土屋}{彦直}
+\sdef{治保の子}{治紀,義和,彦直}
diff --git a/macros/latex/contrib/familytree/samples/Tokugawa/tg-9th.tex b/macros/latex/contrib/familytree/samples/Tokugawa/tg-9th.tex
new file mode 100644
index 0000000000..11edb126df
--- /dev/null
+++ b/macros/latex/contrib/familytree/samples/Tokugawa/tg-9th.tex
@@ -0,0 +1,15 @@
+\idef{}[九代]{家重}[\ftmaleline,生\ymd{1712}][4zw]
+\idef{田安}{宗武}
+\idef{一橋}{宗尹}[\ftmaleline,むねただ]
+\sdef{吉宗の子}{家重,ivalii,宗武,ivalii,宗尹}
+
+\idef{松平}{頼英}
+\indvdldef{松平頼久}{頼久(松平 後の茂承)}
+\sdef{頼学の子}{頼英,松平頼久}
+
+\idef{}{斉脩}
+\idef{松平}{頼恕}
+\idef{}{斉昭}[\ftmaleline][4zw]
+%\idef{松平}{頼筠}
+\indvdldef{頼かた}{頼\UTF{7b60}(松平)}
+\sdef{治紀の子}{斉脩,頼恕,斉昭,頼かた}