有没有办法改变子元素的增长方向?如果我使用了很多节点,内容就会消失在右边距中。一个解决方案是,如果合作伙伴的名字悬在左边而不是右边,那么树就可以在中心周围保持平衡。
我的代码:
\documentclass[
paper = 155mm:220mm,
BCOR = 3mm,
DIV = calc,
11pt,
]
{scrbook}
\usepackage[all]{genealogytree}
\usepackage{rotating}
\newcommand{\ctilde}{\raisebox{0.5ex}{\texttildelow}}
\begin{document}
% \begin{sidewaysfigure}
\begin{genealogypicture}[
% see https://tex.stackexchange.com/q/619151/108384
processing = database,
database format = full,
place text = {\,(}{)},
% place text={(}{)},
event text={\footnotesize}{\,}{}{},
date format = dd.mm.yyyy,
% list separators hang,
level size = 15mm,
% level distance = 10mm,
node size from = 20mm to 30mm, % or just an integer
box clear, % resetting box style
box = {
blanker,
top = 1mm,
bottom = 1mm,
fit basedim = 6pt,
halign = flush center,
valign = top,
% drop fuzzy shadow,
fontupper = \sffamily,
% before upper = {\parskip 0.15\tcbfitdim plus 0pt minus 0pt},
natural height,
},
edges = {
rounded = 1mm,
% swing = 4mm,
% anchoring = center, % center|periphery (default)
foreground = { color = black!90, line width = .3mm },
% background = { color = black!30, line width = 4mm},
}
]
child{
g{
name={NodeName},
birth={1970}{Place},
death={1970}{Place},
}
p{
name={NodeName},
birth={1970}{Place},
death={1970}{Place},
death={1970}{Place},
}
child{
g{
name={NodeName},
birth={1970}{Place},
death={1970}{Place},
}
p{
name={NodeName},
birth={1970}{Place},
death={1970}{Place},
death={1970}{Place},
}
child{
g{
name={NodeName},
birth={1970}{Place},
death={1970}{Place},
}
p{
name={NodeName},
death={1970}{Place},
}
child{
g{
name={NodeName},
birth={1970}{Place},
}
p{
name={NodeName},
birth={1970}{Place},
death={1970}{Place},
}
child{
g{
name={NodeName},
birth={1970}{Place},
death={1970}{Place},
}
p{
name={NodeName},
birth={1970}{Place},
marriage={1761}{}
death={1970}{Place},
}
child{
g{
name={NodeName},
birth={1970}{Place},
death={1970}{Place},
}
p{
name={NodeName},
birth={1970}{Place},
death={1970}{Place},
death={1970}{Place},
}
child{
g{
name={NodeName},
birth={1970}{Place},
death={1970}{Place},
}
p{
name={NodeName},
birth={1970}{Place},
death={1970}{Place},
death={1970}{Place},
}
child{
g{
name={NodeName},
birth={1970}{Place},
death={1970}{Place},
}
p{
name={NodeName},
birth={1970}{Place},
death={1970}{Place},
death={1970}{Place},
}
child{
g{
name={NodeName},
birth={1970}{Place},
death={1970}{Place},
}
p{
name={NodeName},
birth={1970}{Place},
death={1970}{Place},
death={1970}{Place},
}
}
}
}
}
}
}
}
}
}
\end{genealogypicture}
% \end{sidewaysfigure}
\end{document}
答案1
改变作品出现的顺序g-node
。
新的 NodeName4
现在NodeName8
位于左侧。
前
\documentclass[
paper = 155mm:220mm,
BCOR = 3mm,
DIV = calc,
11pt,
]
{scrbook}
\usepackage[all]{genealogytree}
\usepackage{rotating}
\newcommand{\ctilde}{\raisebox{0.5ex}{\texttildelow}}
\begin{document}
% \begin{sidewaysfigure}
\begin{genealogypicture}[% new <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
% see https://tex.stackexchange.com/q/619151/108384
processing = database,
database format = full,
place text = {\,(}{)},
% place text={(}{)},
event text={\footnotesize}{\,}{}{},
date format = dd.mm.yyyy,
% list separators hang,
level size = 15mm,
% level distance = 10mm,
node size from = 20mm to 30mm, % or just an integer
box clear, % resetting box style
box = {
blanker,
top = 1mm,
bottom = 1mm,
fit basedim = 6pt,
halign = flush center,
valign = top,
% drop fuzzy shadow,
fontupper = \sffamily,
% before upper = {\parskip 0.15\tcbfitdim plus 0pt minus 0pt},
natural height,
},
edges = {
rounded = 1mm,
% swing = 4mm,
% anchoring = center, % center|periphery (default)
foreground = { color = black!90, line width = .3mm },
% background = { color = black!30, line width = 4mm},
}
]
child{
g{
name={NodeName1},
birth={1970}{Place},
death={1970}{Place},
}
p{
name={NodeName2},
birth={1972}{Place},
death={1972}{Place},
}
child{
p{
name={NodeName4},
birth={1973}{Place},
death={1973}{Place},
}
g{
name={NodeName3},
birth={1974}{Place},
death={1974}{Place},
}
child{
g{
name={NodeName5},
birth={1975}{Place},
death={1975}{Place},
}
p{
name={NodeName6},
birth={1976}{Place},
death={1976}{Place},
}
child{
p{
name={NodeName8},
birth={1977}{Place},
}
g{
name={NodeName7},
birth={1978}{Place},
death={1978}{Place},
}
child{
g{
name={NodeName9},
birth={1979}{Place},
death={1979}{Place},
}
p{
name={NodeName10},
birth={1980}{Place},
marriage={1985}{Place},
death={1990}{Place},
}
child{
p{
name={NodeName12},
birth={1981}{Place},
death={1981}{Place},
}
g{
name={NodeName11},
birth={1982}{Place},
death={1982}{Place},
}
child{
g{
name={NodeName13},
birth={1983}{Place},
death={1983}{Place},
}
p{
name={NodeName14},
birth={1994}{Place},
death={1994}{Place},
}
child{
g{
name={NodeName15},
birth={1995}{Place},
death={1995}{Place},
}
p{
name={NodeName16},
birth={1996}{Place},
death={1996}{Place},
}
child{
g{
name={NodeName17},
birth={1997}{Place},
death={1997}{Place},
}
p{
name={NodeName18},
birth={1999}{Place},
death={1999}{Place},
}
}
}
}
}
}
}
}
}
}
\end{genealogypicture}
\begin{genealogypicture}[
% see https://tex.stackexchange.com/q/619151/108384
processing = database,
database format = full,
place text = {\,(}{)},
% place text={(}{)},
event text={\footnotesize}{\,}{}{},
date format = dd.mm.yyyy,
% list separators hang,
level size = 15mm,
% level distance = 10mm,
node size from = 20mm to 30mm, % or just an integer
box clear, % resetting box style
box = {
blanker,
top = 1mm,
bottom = 1mm,
fit basedim = 6pt,
halign = flush center,
valign = top,
% drop fuzzy shadow,
fontupper = \sffamily,
% before upper = {\parskip 0.15\tcbfitdim plus 0pt minus 0pt},
natural height,
},
edges = {
rounded = 1mm,
% swing = 4mm,
% anchoring = center, % center|periphery (default)
foreground = { color = black!90, line width = .3mm },
% background = { color = black!30, line width = 4mm},
}
]
child{
g{
name={NodeName1},
birth={1970}{Place},
death={1970}{Place},
}
p{
name={NodeName2},
birth={1972}{Place},
death={1972}{Place},
}
child{
g{
name={NodeName3},
birth={1973}{Place},
death={1973}{Place},
}
p{
name={NodeName4},
birth={1974}{Place},
death={1974}{Place},
}
child{
g{
name={NodeName5},
birth={1975}{Place},
death={1975}{Place},
}
p{
name={NodeName6},
birth={1976}{Place},
death={1976}{Place},
}
child{
g{
name={NodeName7},
birth={1977}{Place},
}
p{
name={NodeName8},
birth={1978}{Place},
death={1978}{Place},
}
child{
g{
name={NodeName9},
birth={1979}{Place},
death={1979}{Place},
}
p{
name={NodeName10},
birth={1980}{Place},
marriage={1985}{Place},
death={1990}{Place},
}
child{
g{
name={NodeName11},
birth={1981}{Place},
death={1981}{Place},
}
p{
name={NodeName12},
birth={1982}{Place},
death={1982}{Place},
}
child{
g{
name={NodeName13},
birth={1983}{Place},
death={1983}{Place},
}
p{
name={NodeName14},
birth={1994}{Place},
death={1994}{Place},
}
child{
g{
name={NodeName15},
birth={1995}{Place},
death={1995}{Place},
}
p{
name={NodeName16},
birth={1996}{Place},
death={1996}{Place},
}
child{
g{
name={NodeName17},
birth={1997}{Place},
death={1997}{Place},
}
p{
name={NodeName18},
birth={1999}{Place},
death={1999}{Place},
}
}
}
}
}
}
}
}
}
}
\end{genealogypicture}
% \end{sidewaysfigure}
\end{document}