사용자 가이드의 기본 예시 중 하나에 결혼 날짜를 추가하려고 하면 사진과 겹치는 수평선이 나타납니다.
내 코드는 다음과 같습니다.
\documentclass{article}
\usepackage{genealogytree}
\usepackage{tcolorbox}
\begin{document}
\begin{genealogypicture}[
processing=database,
database format=medium marriage below,
node size=2.4cm,
level size=3.5cm,
level distance=6mm,
%...
list separators hang,
name font=\bfseries,
surn code={\textcolor{red!50!black}{#1}},
place text={\newline}{},
date format=d/mon/yyyy,
%...
tcbset={male/.style={colframe=blue,colback=blue!5},
female/.style={colframe=red,colback=red!5}},
box={fit basedim=7pt,boxsep=2pt,segmentation style=solid,
halign=left,before upper=\parskip1pt,
\gtrDBsex,drop fuzzy shadow,
if image defined={add to width=25mm,right=25mm,
underlay={\begin{tcbclipinterior}\path[fill overzoom DBimage]
([xshift=-24mm]interior.south east) rectangle (interior.north east);
\end{tcbclipinterior}},
}{},
},
]
sandclock
{
child{
g[id=GauxCarl1777]{
male,
name={Johann \pref{Carl Friedrich} \surn{Gau\ss{}}},
birth={1777-04-30}{Braunschweig (Niedersachsen)},
marriage={1800-01-01}{}, %<== my modification to the guide's example
death={1855-02-23}{G\"ottingen (Niedersachsen)},
profession={Mathematiker, Astronom, Geod\"at und Physiker},
image={Carl_Friedrich_Gauss.jpg},
}
p[id=GauxCarl1777]{
female,
name={Johann \pref{Carl Friedrich} \surn{Gau\ss{}}},
birth={1777-04-30}{Braunschweig (Niedersachsen)},
marriage={1800-01-01}{}, %<== my modification to the guide's example
death={1855-02-23}{G\"ottingen (Niedersachsen)},
profession={Mathematiker, Astronom, Geod\"at und Physiker},
image={Carl_Friedrich_Gauss.jpg},
}
}
}
\end{genealogypicture}
\end{document}
누군가 이것을 방지하는 방법을 알고 있습니까?
답변1
이에 대한 가능한 해결책은 다양합니다. 가장 간단한 방법은 와 같이 선을 긋지 않는 데이터베이스 형식으로 변경하는 것입니다 medium
. 이 경우 결혼은 출생과 사망 사이에 인쇄됩니다.
MWE:
\documentclass{article}
\usepackage{genealogytree}
\usepackage{tcolorbox}
\begin{document}
\begin{genealogypicture}[
processing=database,
database format=medium,
box={fit basedim=7pt,boxsep=2pt,segmentation style=solid,
halign=left,before upper=\parskip1pt,
\gtrDBsex,drop fuzzy shadow,
if image defined={add to width=25mm,right=25mm,
underlay={\begin{tcbclipinterior}\path[fill overzoom image=\gtrDBimage]
([xshift=-24mm]interior.south east) rectangle (interior.north east);
\end{tcbclipinterior}},
}{},
},
]
sandclock{
child{
g[id=GauxCarl1777]{
male,name={Johann \pref{Carl Friedrich} \surn{Gau\ss{}}},
birth={1777-04-30}{Braunschweig (Niedersachsen)},
marriage={1800-01-01}{},
death={1855-02-23}{G\"ottingen (Niedersachsen)},
profession={Mathematiker, Astronom, Geod\"at und Physiker},
image={Carl_Friedrich_Gauss.jpg},
}
}
child{
g[id=GauxCarl1777]{
female,name={Johann \pref{Carl Friedrich} \surn{Gau\ss{}}},
birth={1777-04-30}{Braunschweig (Niedersachsen)},
marriage={1800-01-01}{},
death={1855-02-23}{G\"ottingen (Niedersachsen)},
profession={Mathematiker, Astronom, Geod\"at und Physiker},
}
}
}
\end{genealogypicture}
\end{document}
결과:
medium marriage below
두 번째 가능성은 선을 제거하기 위해 정의를 변경하는 것입니다 . 정의는 파일에 나열되며 gtrcore.node.code.tex
로드 후 문서에 수정된 코드를 추가하여 재정의할 수 있습니다 genealogytree
.
MWE:
\documentclass{article}
\usepackage{genealogytree}
\usepackage{tcolorbox}
\makeatletter
\gtrDeclareDatabaseFormat{medium marriage below}{}{%
\gtrPrintName%
\begin{gtreventlist}%
\gtr@list@event@birth%
\gtr@list@event@floruit%
\gtr@list@event@death%
\end{gtreventlist}%
\gtr@print@infolist%
\gtr@ifmarriagedefined{%
\begin{gtreventlist}\gtr@list@event@marriage\end{gtreventlist}}{}%
% was: \gtr@ifmarriagedefined{\tcbline\begin{gtreventlist}\gtr@list@event@marriage\end{gtreventlist}}{}%
}
\makeatother
\begin{document}
\begin{genealogypicture}[
processing=database,
database format=medium marriage below,
box={fit basedim=7pt,boxsep=2pt,segmentation style=solid,
halign=left,before upper=\parskip1pt,
\gtrDBsex,drop fuzzy shadow,
if image defined={add to width=25mm,right=25mm,
underlay={\begin{tcbclipinterior}\path[fill overzoom image=\gtrDBimage]
([xshift=-24mm]interior.south east) rectangle (interior.north east);
\end{tcbclipinterior}},
}{},
},
]
sandclock{
child{
g[id=GauxCarl1777]{
male,name={Johann \pref{Carl Friedrich} \surn{Gau\ss{}}},
birth={1777-04-30}{Braunschweig (Niedersachsen)},
marriage={1800-01-01}{},
death={1855-02-23}{G\"ottingen (Niedersachsen)},
profession={Mathematiker, Astronom, Geod\"at und Physiker},
image={Carl_Friedrich_Gauss.jpg},
}
}
child{
g[id=GauxCarl1777]{
female,name={Johann \pref{Carl Friedrich} \surn{Gau\ss{}}},
birth={1777-04-30}{Braunschweig (Niedersachsen)},
marriage={1800-01-01}{},
death={1855-02-23}{G\"ottingen (Niedersachsen)},
profession={Mathematiker, Astronom, Geod\"at und Physiker},
}
}
}
\end{genealogypicture}
\end{document}
결과:
이 솔루션을 약간 확장하려면 이미지가 있는지 테스트하고 이미지가 없는 노드에 대한 줄만 인쇄할 수 있습니다. 예를 들어 그렇지 않으면 약간의 수직 공간을 인쇄할 수 있습니다.
MWE, 재정의의 관련 부분만 표시됨:
\gtr@ifmarriagedefined{%
\ifdefvoid{\gtrDBimage}{\tcbline}{\vspace{2mm}}%
\begin{gtreventlist}\gtr@list@event@marriage\end{gtreventlist}}{}%
결과:
또는 \tcbline
두 경우 모두 추가하면 이미지가 있는 경우 선이 24mm 더 짧아집니다.
\gtr@ifmarriagedefined{%
\ifdefvoid{\gtrDBimage}{\tcbline}{%
\tcbline@ {\kvtcb@leftupper +\@totalleftmargin +24mm}}%
\begin{gtreventlist}\gtr@list@event@marriage\end{gtreventlist}}{}%
결과: