4

I'm building a family tree using the genealogytreepackage, and I have bumped into a small problem. Perhaps this is a bug, or there is a workaround.

The grandfather of c3 had three wives. c3 is a descendant of the child (c1) of the third wife (bb1). I want to draw a path connecting the great grandfather (a1) to c3.

Here's an MWE:

\documentclass[]{standalone}
\usepackage[all]{genealogytree}
\begin{document}
\begin{genealogypicture}[
template=formal graph,
extra edges prepend for families={
x={famA}{a1}{b1},
x={famB}{b1}{c1}, 
x={famC}{c1}{c3},
}{
foreground={red!25!yellow,line width=5pt},no background}
]
child[id=famA]{%
   g[id=a1]{a1}
   p[id=a2]{a2}
   child[id=famB]{%
      g[id=b1]{b1}
      p[id=b2]{b2}
      c[id=b3]{b3}
      union[id=famBa]{%
         p[id=ba1]{ba1}
         c[id=ba2]{ba2}
      }
      union[id=famBb]{%
         p[id=bb1]{bb1}
         child[id=famC]{%
            g[id=c1]{c1}
            p[id=c2]{c2}
            c[id=c3]{c3}
         }
      }
   }
}
\end{genealogypicture}
\end{document}

The problem is along the path x={famB}{b1}{c1}, the yellow line connects to c1 along the wrong path. Is there a way to fix this, or is it a bug?

  • I've abused the comment features of the site to ping the package author. I have no idea if this is a bug, a limitation or a feature :(. – cfr Oct 22 '15 at 23:25
  • The fix is to use x={famB}{b1}{c1} as @pst wrote. But, maybe, rearranging like @cfr did is also an alternative for you. – Thomas F. Sturm Oct 23 '15 at 7:12
3

Don't you simply mean x={famBb}{b1}{c1} instead of x={famB}{b1}{c1}, since that is the union with c1? (The documentation for extra edges says that parents and children in the construction "do not necessarily have to be real members of the current family", so you got a result anyway.)

Then you get

enter image description here

  • You were minutes faster than me to give this answer :-) I agree that famBb is the correct family to highlight. – Thomas F. Sturm Oct 23 '15 at 6:15
  • Excellent! The documentation for Genealogytree is quite precise, but not always clear. – SteelAngel Oct 23 '15 at 12:04
1

This is not a solution but it might be of interest as a workaround, depending on the details of your situation. In any case, it is too long for a comment.

It seems that the path followed corresponds to the primary partner, so to speak. Hence, if you can alter these relationships, you can highlight the relevant relationships.

For example:

corrected relationships

As I say, I have no idea whether this is of any help at all. Hopefully, the package author will see find his way to your post and provide a satisfactory solution. But I thought it worth posting this in case it was of some use in the meantime.

Code:

\documentclass[border=10pt,tikz]{standalone}
\usepackage[all]{genealogytree}
\begin{document}
\begin{genealogypicture}
  [
    template=formal graph,
    extra edges prepend for families={
      x={famA}{a1}{b1},
      x={famB}{b1}{c1},
      x={famC}{c1}{c3},
    }{
      foreground={red!25!yellow,line width=5pt},no background
    }
  ]
  child[id=famA]{%
    g[id=a1]{a1}
    p[id=a2]{a2}
    child[id=famB]{%
      g[id=b1]{b1}
      union[id=famX]{%
        p[id=b2]{b2}
        c[id=b3]{b3}
      }
      union[id=famBa]{%
        p[id=ba1]{ba1}
        c[id=ba2]{ba2}
      }
        p[id=bb1]{bb1}
        child[id=famC]{%
          g[id=c1]{c1}
          p[id=c2]{c2}
          c[id=c3]{c3}
        }
    }
  }
\end{genealogypicture}
\end{document}
  • 1
    I think @pst posted the correct answer to the primary problem, i.e. the wrong family was selected in the original code. But in my opinion, your answer shows a good alternative by rearranging the code :-) – Thomas F. Sturm Oct 23 '15 at 6:29
  • @ThomasF.Sturm Thanks for looking. So you can highlight the connection between b1 and c1 for family famBb even though b1 is not created within famBb? Is this because b1 is the g node? – cfr Oct 23 '15 at 12:11
  • You could also do weird things like x={famB}{ba2}{c1} which would connect ba2 with c1. Here, the edge would go up to reach the height of the famB center and then go down. The famB family id serves as position information, even if all connected nodes are not family members. – Thomas F. Sturm Oct 23 '15 at 17:21
  • @ThomasF.Sturm Thanks for that explanation. It actually makes much more sense now. (I'm sure it is in the documentation but there is quite a lot of it, which is good, obviously, but it is sometimes hard to find things. As with the TikZ manual.) – cfr Oct 23 '15 at 19:32

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.