林木谱系

林木谱系

如何获取反映代码中括号中参数顺序的 PDF?

My father 
My father's father 
My father's mother
My mother   
My mother's father 
My mother's mother

如果你看到 PDF 图,它就是相反的。我从 排版家谱

\documentclass[tikz,12pt]{standalone}
\usetikzlibrary{calc,positioning,backgrounds,arrows.meta}
\usepackage{forest}
\pagestyle{empty}

\begin{document}

\begin{forest}
  for tree={
    child anchor=west,
    parent anchor=east,
    grow=east,
    draw,
    anchor=west,
    edge path={
      \noexpand\path[\forestoption{edge}]
        (.child anchor) -| +(-5pt,0) -- +(-5pt,0) |-
        (!u.parent anchor)\forestoption{edge label};
    },
  }
[Me
    [My Father
      [My Father's Father
      ]
      [My Father's Mother
      ]
    ]
    [My Mother
      [My Mother's Father
      ]
      [My Mother's Mother
      ]
    ]
  ]
\end{forest}

\end{document}

\end{document}

答案1

尽管这对于这棵简单的树来说效果很好,但请注意,您最好使用较新的 genealogytree 包来绘制家谱。

\documentclass[12pt]{standalone}
\usepackage[all]{genealogytree}

\pagestyle{empty}

\begin{document}
\begin{genealogypicture}[
  timeflow=left,
  level size=5cm,
  node size=1cm,
  box={halign=center, valign=center},
  ]
  parent{
    g{Me}
    parent{
      g{My Father}
      p{My Father's Father}
      p{My Father's Mother}
    }
    parent{
      g{My Mother}
      p{My Mother's Father}
      p{My Mother's Mother}
    }
  }
\end{genealogypicture}
\end{document}

enter image description here

答案2

为了恢复孩子们在树中如参数所示,您需要在树选项中的'单词后立即添加字符,如下所示: 。growgrow'=east

它将显示从上到下的预期顺序。因此,使用相同的代码

[Me
    [My Father
      [My Father's Father
      ]
      [My Father's Mother
      ]
    ]
    [My Mother
      [My Mother's Father
      ]
      [My Mother's Mother
      ]
    ]
  ]

我们获得以下输出:

成长=东方

enter image description here

成长'=东方

enter image description here

相关内容