我尽我所能以最好的方式复制这棵祖先树但我还没有完全成功。我该怎么做才能让安东尼亚二世只与德鲁苏斯一世(婚姻)相关联。我该如何像模板上那样在提比略扩展这个分支?附上我的 LaTeX 代码。
\documentclass[12pt,landscape]{article}
\usepackage[a3paper]{geometry}
\usepackage[all]{genealogytree}
\begin{document}
\section{Stammbaum des Caligula}
\begin{tikzpicture}
\genealogytree[template=signpost,
label options={fill=white,node font=\footnotesize},]{
parent{
p[male]{CLAUDIUS}
g[male]{Nero}
parent{
p[male]{Germanicus}
c[male]{Nero Germanici}
c[male]{Drusus III}
c[male]{CALIGULA}
c[female]{Drusilla}
c[female]{Livilla II}
g[female]{Agrippina II}
parent{
c[male]{C. Caesar}
c[male]{L. Caesar}
c[male]{Agrippa Postumus}
g[female]{Agrippina I}
p[male]{Agrippa}
parent{
g[female]{Iulia}
c[male]{TIBERIUS}
c[male]{Drusus I}
parent{
g[male]{AUGUSTUS}
p[male]{C. Iulius Caesar}
}
p[female]{Livia}
}
parent{
g[female]{Antonia II}
parent{
g[female]{Octavia}
}
p[male]{M. Antonius}
}
}
}
}
}
\end{tikzpicture}
\end{document}
请帮我 :-)
答案1
Genealogytree 可以自动化一些事情,但是由于许多基于 tikz 的临时包限制了高度个性化的选项,因此您只能使用基本的 tikz 代码来绘制几乎所有 2d 参数化的内容,在这种情况下,它有助于定位 tikz 库和箭头元来控制关系样式的箭头大小,以获得受线大小影响的相同终止大小,我使用标签节点来放置性别符号。
结果 :
梅威瑟:
\documentclass[border=5pt,tikz]{standalone}
\usepackage{wasysym}
\usetikzlibrary{positioning,arrows.meta}
\begin{document}
\begin{tikzpicture}[
%Environment cfg
>={Straight Barb[length=4pt]},
%Environment Styles
Male/.style={
label={[draw,blue,circle,inner sep=1pt]#1:\male}
},
Female/.style={
label={[draw,magenta,circle,inner sep=1pt]#1:\female}
},
Parents/.style={line width=0.75 pt},
Rel1/.style={line width=2 pt,dash pattern= on 7pt off 3pt},
Dir/.style={line width=2 pt},
Adop/.style={line width=1 pt,dash pattern= on 7pt off 3pt}
]
\path
node(CIC)[Male=180]{C. Iulius Caesar}
node(AUG)[Male=180,below= of CIC]{AUGUSTUS}
node(LIV)[Female=0,right= of AUG]{Livia}
(AUG) -- (LIV) node[midway](AUGxLIV){$\infty$}
node(OCT)[Female=180,right= 4.5 of LIV]{Octavia}
node(MA)[Male=0,right= 2.5 of OCT]{M. Antonius}
(OCT) -- (MA) node[midway](OCTxMA){$\infty$}
node(AGR)[Male=180,below left= 2 and 4.5 of AUG]{Agrippa}
node(IUL)[Female=0,right= of AGR]{Iulia}
(AGR) -- (IUL) node[midway](AGRxIUL){$\infty$}
node(TIB)[Male=180,right= 4.5 of IUL]{TIBERIUS}
node(DRU-I)[Male=180,right=2.5 of TIB]{Drusus I}
node(ANT-II)[Female=0,right=2 of DRU-I]{Antonia II}
(DRU-I) -- (ANT-II) node[midway](DRU-IxANT-II){$\infty$}
node(DRU-II)[Male=180,below left= 2 and -1.5 of TIB]{Drusus II}
node(LIV-I)[Female=0,right= of DRU-II]{Livilla I}
(DRU-II) -- (LIV-I) node[midway](DRU-IIxLIV-I){$\infty$}
node(TIB-G)[Male=180,below= of DRU-IIxLIV-I]{Tiberius Gemellus}
node(CC)[Male=180,below=6 of AGR]{C. Caesar}
node(LC)[Male=180,right= of CC]{L. Caesar}
node(AP)[Male=180,right= of LC,text depth=-\baselineskip,align=center]{Agrippa \\ Postumus}
node(AGP-I)[Female=180,right= 1.5 of AP]{Agrippina I}
node(GER)[Male=0,right= 2 of AGP-I]{Germanicus}
(AGP-I) -- (GER) node[midway](AGP-IxGER){$\infty$}
node(CAL)[Male=180,below=2 of AGP-I]{CALIGULA}
node(DRU-III)[Male=180,left= of CAL]{Drusus III}
node(NG)[Male=180,left=2 of DRU-III]{Nero Germanici}
node(DRUS)[Female=180,right= of CAL]{Drusilla}
node(LIV-II)[Female=180,right= of DRUS]{Livilla II}
node(AGP-II)[Female=180,right= of LIV-II]{Agrippina II}
node(CLA)[Male=0,right=2 of AGP-II]{CLAUDIUS}
(AGP-II) -- (CLA) node[midway](AGP-IIxCLA){$\infty$}
node(NE)[Male=180,below= of AGP-II]{NERO}
;
\draw[Parents,<->] (LIV) -- ++(0,0.75) -| (OCT);
\draw[Parents,<->] (TIB) -- ++(0,0.75) coordinate(T1) -| (DRU-I);
\draw[Parents,<->] (LIV-I.75) -- ++(0,0.5) coordinate(T2) -| (CLA);
\draw[Parents,<->] (CC) -- ++(0,0.75) coordinate(T3) -| (AGP-I);
\draw[Parents,<->] (NG) -- ++(0,0.75) coordinate(T4) -| (AGP-II);
\draw[Parents,->](TIB.-150) -- (TIB.-150 |- DRU-II.90);
\draw[Parents,->](DRU-IIxLIV-I) -- (TIB-G);
\draw[Parents,->](T3 -| LC) -- (LC);
\draw[Parents,->](T3 -| AP) -- (AP);
\draw[Parents,->](T4 -| DRU-III) -- (DRU-III);
\draw[Parents,->](T4 -| CAL) -- (CAL);
\draw[Parents,->](T4 -| DRUS) -- (DRUS);
\draw[Parents,->](T4 -| LIV-II) -- (LIV-II);
\draw[Parents,->](AGP-II) -- (NE);
\draw[Rel1,->]
(CIC) edge (AUG)
(AUG) edge (TIB.150)
(TIB.-15) -- (LIV-I)[shorten >=8pt] -- (GER);
\draw[Dir,->](AUG.-165) -- (IUL.50);
\draw[Dir,->](LIV) -- (LIV |- T1) -| (DRU-I);
\draw[Dir,->](OCTxMA) -- (ANT-II);
\draw[Dir,->](DRU-IxANT-II) -- (DRU-IxANT-II |- T2) -| (GER);
\draw[Dir,->](AGRxIUL) -- (AGRxIUL |- T3) -| (AGP-I);
\draw[Dir,->](AGP-IxGER) -- (AGP-IxGER |- T4) -| (CAL);
\draw[Adop,->](AUG.-160) -- (CC.20);
\draw[Adop,->](AUG.-155) -- (LC.30);
\draw[Adop,->](AUG.-145) -- (AUG.-145 |- AP.90);
\draw[Adop,->](CLA.-90) -- (NE);
\draw[Dir] (AGR.180 |- NE.-90) coordinate (T5)-- ++ (1,0) node[anchor=west]{direkte Abstammung};
\draw[Adop](T5)++(5,0) -- ++ (1,0)node[anchor=west]{Adoption};
\end{tikzpicture}
\end{document}
为什么要有独立文档类? 该文档类自动调整画布大小并添加一些边框,因此您可以在绘图时无需关心主文档的页面尺寸,因为您可以使用以下方式在图形环境页面中导入已编译的 pdf 输出:
\includegraphics[width=\textwidth]{my_tikz_draw_in_standalone_class_file_pdf_output.pdf}
因此,导入 tikz 绘图时不会丢失其矢量属性,如果字体与主文档不同,则只需将定义文本样式的行从主文档复制到独立类 tikz 绘图中。