TeX - LaTeX Asked by Chris Yungmann on February 13, 2021
How can I reuse a portion of a graph between two different genealogytree
instances? Here is a simplified example of code that just uses manual duplication, but I would like to extract out the graph in the second one to a command or similar to use as part of the first tree.
documentclass{letter}
usepackage[all]{genealogytree}
begin{document}
begin{autosizetikzpicture}{linewidth}{}
genealogytree[]{
parent{
g{Child A}
parent{
g{Parent A}
p{Grandparent A}
p{Grandparent B}
}
parent{
g{Parent B}
p{Grandparent C}
p{Grandparent D}
}
}
}
end{autosizetikzpicture}
begin{autosizetikzpicture}{linewidth}{}
genealogytree[]{
parent{
g{Parent A}
p{Grandparent A}
p{Grandparent B}
}
}
end{autosizetikzpicture}
end{document}
I tried defining the second tree inside a newcommand*
but then get Package genealogytree Error: Parser: unfeasible token.
when I try to use it.
I think I found a solution using the insert
control sequence documented in §4.10 Control Sequence 'insert' (p. 75) of the manual:
documentclass{letter}
usepackage[all]{genealogytree}
begin{document}
newcommand*{secondTree}{%
parent{
g{Parent A}
p{Grandparent A}
p{Grandparent B}
}
}
begin{autosizetikzpicture}{linewidth}{}
genealogytree[]{
parent{
g{Child A}
insert{secondTree}
parent{
g{Parent B}
p{Grandparent C}
p{Grandparent D}
}
}
}
end{autosizetikzpicture}
begin{autosizetikzpicture}{linewidth}{}
genealogytree[]{
insert{secondTree}
}
end{autosizetikzpicture}
end{document}
Answered by Chris Yungmann on February 13, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP