5

When dealing with a very large tree using genealogytree, I would like to isolate some parts; not just highlight, but isolate, meaning excluding everything else. The tree is already coded so I would prefer avoiding splitting it in two trees.

For example, below, is it possible to keep only the minimum leading from Grandpa Doe to Charles and siblings? So that:

enter image description here

becomes:

enter image description here

Preserved nodes could be indicated by family id or node id, for example. This can be cumbersome, but is much easier than commenting or deleting the extra lines of code. There might be a simple way of doing it, and that's what I am asking for here.

Another possibility, which would probably require a package enhancement, would be to detect who to keep in-between two nodes. From two node ids, it would join them with the shortest path, and add every missing parent (and, possibly siblings).

I have found the options options for family and edges for family but that is not a very sound approach to excludes nodes by setting a tiny size or a white color.

Code for first tree:

\documentclass[tikz]{standalone}
\usepackage[all]{genealogytree}
\usepackage{times}
\usepackage{mtpro2}

\begin{document}
\begin{tikzpicture}
\genealogytree[template=signpost,
%options for family={Smith}{box={width=2cm,colback=white}},
%edges for family={Smith}{none},
]
{
    parent[id=SmithDoe]{
        g[id=Arth2008,male]{Arthur\\\gtrsymBorn\,2008}
        c[id=Bert2010,female]{Berta\\\gtrsymBorn\,2010}
        c[id=Char2014,male]{Charles\\\gtrsymBorn\,2014}
        parent[id=Smith]{
            g[id=John1980,male]{John Smith\\\gtrsymBorn\,1980}
            p[id=GpSm1949,male]{Grandpa Smith\\\gtrsymBorn\,1949}
            p[id=GmSm1952,female]{Grandma Smith\\\gtrsymBorn\,1952}
        }
        parent[id=Doe]{
        g[id=Jane1982,female]{Jane Doe\\\gtrsymBorn\,1982}
        c[id=Harr1987,male]{Uncle Harry\\\gtrsymBorn\,1987}
        p[id=GpDo1955,male]{Grandpa Doe\\\gtrsymBorn\,1955}
        p[id=GmDo1956,female]{Grandma Doe\\\gtrsymBorn\,1956}
        }
    }
}
\end{tikzpicture}
\end{document}
3

There is the ignore node key, used as

ignore node={GpSm1949,GmSm1952,Harr1987}

I.e. it lets you provide a list of ids that you want to remove from the tree.

There are various options for ignoring stuff, see section 5.11 Ignoring input in the manual.

output of code

\documentclass[tikz,border=5mm]{standalone}
\usepackage[all]{genealogytree}
\begin{document}
\begin{tikzpicture}
\genealogytree[template=signpost,
  ignore node={GpSm1949,GmSm1952,Harr1987}
]
{
    parent[id=SmithDoe]{
        g[id=Arth2008,male]{Arthur\\\gtrsymBorn\,2008}
        c[id=Bert2010,female]{Berta\\\gtrsymBorn\,2010}
        c[id=Char2014,male]{Charles\\\gtrsymBorn\,2014}
        parent[id=Smith]{
            g[id=John1980,male]{John Smith\\\gtrsymBorn\,1980}
            p[id=GpSm1949,male]{Grandpa Smith\\\gtrsymBorn\,1949}
            p[id=GmSm1952,female]{Grandma Smith\\\gtrsymBorn\,1952}
        }
        parent[id=Doe]{
        g[id=Jane1982,female]{Jane Doe\\\gtrsymBorn\,1982}
        c[id=Harr1987,male]{Uncle Harry\\\gtrsymBorn\,1987}
        p[id=GpDo1955,male]{Grandpa Doe\\\gtrsymBorn\,1955}
        p[id=GmDo1956,female]{Grandma Doe\\\gtrsymBorn\,1956}
        }
    }
}
\end{tikzpicture}
\end{document}
  • Could it be adapted to ignore nodes starting by xyz? That's to avoid enumerating all nodes in a long list. – anderstood Jan 16 '18 at 16:29
  • @anderstood There is an ignore subtree key as well (manual section 5.11, as mentioned above), but ignore subtree={Smith} removes also John Smith. Beyond that, I don't know more than what is said in the manual, which you can read as well as me. – Torbjørn T. Jan 16 '18 at 16:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.