3

I have tried to insert marriage dates on edges in a sandclock familytree, but the proband parents and grandparents dates are placed on the wrong side.

\documentclass[12pt,danish]{article}
\usepackage[all]{genealogytree}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[danish]{babel}

\begin{document}

\begin{genealogypicture}[
  timeflow=right,               % time flows down
  processing=database,
  database format=medium no marriage,
  node size=2cm,   % width of nodes
  level size=3.7cm,              % height of nodes
  level distance=8mm,          % generation distance
  list separators hang,
name font=\Large,
  place text={\newline}{},
  date format=d-m-yyyy,
                               % redefine default setting for female,male,neuter:
  tcbset={
    female/.style={colback=red!20,arc=1mm},
    male/.style={colback=blue!20,sharp corners},
  },
  box={fit basedim=7pt,boxsep=2pt,segmentation style=solid,
  halign=left,before upper=\parskip1pt,
  \gtrDBsex,drop fuzzy shadow,
  },
  %
  edges={foreground={black,line width=0.25mm},    % edge settings
         background={white,line width=0.5mm}},
         % Tried to use pivot without success
         %options for node={farfar,far,mig,anne}{pivot},
%Formatting marriage-edge-labels
label database options={place text={(}{)}},
label options={fill=white,rotate=90,node font=\small,inner sep=0.5mm,draw=green!30!black,sloped,anchor=south,auto=true}
]
  %%%%%% the graph %%%%%%
  sandclock   {
  child[id=migkirsten,family database={marriage={1961-08-22}{}}]{
    g[id=mig]{  %proband
    male,
    name={Proband},
    birth={1937-02-17}{}
    }
 p[id=kirsten]{
    female,
    name={Kirsten{}},
    birth={1941-03-14}{}
    }
    c[id=anne]{
        female,
        name={Anne {}},
        birth={1962-01-17}{}
        }
          c[id=erik]{
            male,
            name={Erik {}},
            birth={1975-09-07}{}
            }
             }
         parent[id=farogmor,family database={marriage={1936-04-30}{}}]{
g[id=far]{
    male,
    name={Niels },
    birth={1908-04-04}{},
    death={1962-03-01}{}
    }
    parent[id=farfarfarmor,family database={marriage={1905-05-28}{}}]{
    g[id=farfar]{
        male,
        name={Anders },
        birth={1872-01-14}{},
        death={1956-10-17}{}
        }
        }
        parent{
        g[id=farmor]{
            female,
            name={Thyra },
            birth={1880-09-05}{},
            death={1920-06-01}{}
            }
                      }
                  }
                  c[id=ingeborg]{
        female,
        name={Ingeborg },
        birth={1938-08-05}{}
                }
    parent{
          g[id=mor]{
              female,
              name={Else },
              birth={1913-10-29}{},
              death={2007-01-04}{}
              }
                  }
    }
          \end{genealogypicture}

\end{document}

Hope someone can tell me what to do to move the marriage-dates from the left to the right side of the parents generations.

Bonus questions: 1. How can I get the out-commented pivot Work (I want Anders,Niels,Proband and Anne on a horizontal line in the top)? 2. How can I center the Picture on the page - something like \centerfloat?

Here is the current family tree.

enter image description here

1
  • Welcome to TeX.SX! Maybe someone takes up the challenge to wade through your code anyway. Otherwise try to make the problem more manageable by stripping done the code to a minimal (well, at least smaller) tree that still shows the problem. And in general it is better to ask only one question per posting; three questions = three postings. Last point: just in case this is real data, be aware that the code will stay online for a long time; maybe you want to replace it by fictitious persons (and ask the moderators to delete the edit history).
    – gernot
    Commented Nov 7, 2016 at 0:01

1 Answer 1

1

The answer to the main question is, that marriage dates for the parent and grandparent generation are not placed correctly.

For example, the proband is parent of the family with id migkirsten which is correctly labeled. The proband is also child to the sandclock family which is not labeled, but should be labeled 1961-08-22.

Further, Niels is child to the family with id farogmar, which should get the label 1905-05-28.

Finally, the family with id farfarfarmor consists of a child Anders without parents - therefore, the label for his parents hangs in the air on the left hand side.

The following code corrects the labels:

\documentclass[12pt,danish]{article}
\usepackage[all]{genealogytree}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[danish]{babel}

\usepackage[margin=1cm]{geometry}

\begin{document}

\begin{genealogypicture}[
  timeflow=right,               % time flows down
  %show id,
  processing=database,
  database format=medium no marriage,
  node size=2cm,   % width of nodes
  level size=3.7cm,              % height of nodes
  level distance=8mm,          % generation distance
  list separators hang,
  name font=\Large,
  place text={\newline}{},
  date format=d-m-yyyy,
                               % redefine default setting for female,male,neuter:
  tcbset={
    female/.style={colback=red!20,arc=1mm},
    male/.style={colback=blue!20,sharp corners},
  },
  box={fit basedim=7pt,boxsep=2pt,segmentation style=solid,
  halign=left,before upper=\parskip1pt,
  \gtrDBsex,drop fuzzy shadow,
  },
  %
  edges={foreground={black,line width=0.25mm},    % edge settings
         background={white,line width=0.5mm}},
         % works for me:
         options for node={farfar,far,mig,anne}{pivot},
  %Formatting marriage-edge-labels
  label database options={place text={(}{)}},
  label options={fill=white,
    rotate=90,
    node font=\small,inner sep=0.5mm,
    draw=green!30!black,sloped,
    anchor=south,
    auto=true}
]
  %%%%%% the graph %%%%%%
  sandclock[family database={marriage={1936-04-30}{}}]   {
  child[id=migkirsten,family database={marriage={1961-08-22}{}}]{
    g[id=mig]{  %proband
    male,
    name={Proband},
    birth={1937-02-17}{}
    }
 p[id=kirsten]{
    female,
    name={Kirsten{}},
    birth={1941-03-14}{}
    }
    c[id=anne]{
        female,
        name={Anne {}},
        birth={1962-01-17}{}
        }
          c[id=erik]{
            male,
            name={Erik {}},
            birth={1975-09-07}{}
            }
             }
         parent[id=farogmor,family database={marriage={1905-05-28}{}}]{
g[id=far]{
    male,
    name={Niels },
    birth={1908-04-04}{},
    death={1962-03-01}{}
    }
    parent[id=farfarfarmor]{
    g[id=farfar]{
        male,
        name={Anders },
        birth={1872-01-14}{},
        death={1956-10-17}{}
        }
        }
        parent{
        g[id=farmor]{
            female,
            name={Thyra },
            birth={1880-09-05}{},
            death={1920-06-01}{}
            }
                      }
                  }
                  c[id=ingeborg]{
        female,
        name={Ingeborg },
        birth={1938-08-05}{}
                }
    parent{
          g[id=mor]{
              female,
              name={Else },
              birth={1913-10-29}{},
              death={2007-01-04}{}
              }
                  }
    }
          \end{genealogypicture}

\end{document}

This gives:

enter image description here

The pivot code works for me as the picture shows...

In the original code, the text width was too small to hold the picture. I enlarged the text width using the geometry package to get all of the picture onto the paper.

2
  • It's great to get the mariage labels on the correct side. I tried to make a pivot shift on the sandclock option, and it moves the tree as expected, but the mariage label doesn't seems to move along with the tree - why? Commented Jan 18, 2017 at 18:51
  • The labels are (or should be) positioned at the center of a family. But they can be moved by something like anchor=south as in the example. One could add some xshift or yshift for final tweaks. Commented Jan 19, 2017 at 11:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .