避免 p 和 union 在 generologytree 中相交

避免 p 和 union 在 generologytree 中相交

我希望虚线和实线边缘进入“妻子框”时可以反过来进入,以避免相交。

\documentclass{article}
\usepackage[all]{genealogytree}             
\begin{document}
\gtrset{
    level 0/.style={level distance = 5mm},
    dashed/.style={family edges={foreground={black,very thick,dashed},xshift=-1cm}}
}
\begin{tikzpicture} 
\genealogytree[timeflow = right,box={height=5mm,width=25mm,halign=center}]{ % 
    child{
        union[dashed]{
                p[male,tikz={yshift=5mm}] {  A.N.Other }
                    c[female,tikz={yshift=2mm}] {  Out of wedlock }
            }
        g[female] {  Wife }
        p[male] {  Husband}
                    c[male] {  Child of marriage }
    }
   }
\end{tikzpicture}
\end{document}

答案1

%The trick is to include a second "union" command
    \documentclass{article}
\usepackage[all]{genealogytree}             
\begin{document}
\gtrset{
    level 0/.style={level distance = 5mm},
    dashed/.style={family edges={foreground={black,very thick,dashed},xshift=-1cm}}
}

\subsection*{Original layout}

\begin{tikzpicture} 
\genealogytree[timeflow = right,box={height=5mm,width=25mm,halign=center}]{ % 
    child{
        union[dashed]{
                p[male,tikz={yshift=5mm}] {  A.N.Other }
                    c[female,tikz={yshift=2mm}] {  Out of wedlock }
            }
        g[female] {  Wife }
        p[male] {  Husband}
                    c[male] {  Child of marriage }
    }
   }
\end{tikzpicture}

\subsection*{Layout with second union command}
\begin{tikzpicture} 
\genealogytree[timeflow = right,box={height=5mm,width=25mm,halign=center}]{ % 
    child{
        union[dashed]{
                p[male,tikz={yshift=5mm}] {  A.N.Other }
                    c[female,tikz={yshift=2mm}] {  Out of wedlock }
            }
        g[female] {  Wife }
    union{
        p[male] {  Husband}
                    c[male] {  Child of marriage }
    }
    }
   }
\end{tikzpicture}

\end{document}

原始输出和更正输出

相关内容