0

How to change the position of a whole tree on the paper?

I tried to shift my tree 3cm to the right and 10cm down, but it doesn't work:

\documentclass[a4paper,10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[all]{genealogytree}
\pagestyle{empty}

% /gtr/set position=node at position
% (style, no default)
% Adjusts the current graph such that a node of the graph is placed at the given position.
% If the position is given by coordinates, one has to use curly brackets to enclose the position.
% (Handbook ``5.9 tree positioning options'', p.109)

\begin{document}
  \begin{tikzpicture}

    \genealogytree
    [
        template=signpost,timeflow=down,
        set position=son1 at {3cm,10cm}  % doesn't work :(
    ]{
       parent[id=g1]{
         g[id=son1,male]{son 1}
         c[male]{son 2}
         c[female]{daughter}
         parent{
           g[male]{father}
           p[male]{grandpa 1}
           p[female]{grandma 1}
         }
         parent{
           g[female]{mother}
           p[male]{grandpa 2}
           p[female]{grandma 2}
         }
       }  
     }     

   \end{tikzpicture}
\end{document}
2
  • Of course I should not expect a shifting but setting an absolute position: sorry about!
    – P. Nessen
    Commented Apr 19, 2018 at 13:52
  • This answer should be relevant: tex.stackexchange.com/a/123900/121944
    – AML
    Commented Apr 19, 2018 at 13:57

1 Answer 1

1

Added a node and adjust position.

\documentclass[a4paper,10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[all]{genealogytree}
\pagestyle{empty}

% /gtr/set position=node at position
% (style, no default)
% Adjusts the current graph such that a node of the graph is placed at the given position.
% If the position is given by coordinates, one has to use curly brackets to enclose the position.
% (Handbook ``5.9 tree positioning options'', p.109)

\begin{document}
  \begin{tikzpicture}
  \node(X)[above=10cm] at (0,0) {}; %added this line
    \genealogytree
    [
        template=signpost,timeflow=down,
        adjust position=son1 right of {0,0} distance 3cm %added this line
    ]{
       parent[id=g1]{
         g[id=son1,male]{son 1}
         c[male]{son 2}
         c[female]{daughter}
         parent{
           g[male]{father}
           p[male]{grandpa 1}
           p[female]{grandma 1}
         }
         parent{
           g[female]{mother}
           p[male]{grandpa 2}
           p[female]{grandma 2}
         }
       }  
     }     

   \end{tikzpicture}
\end{document}

My tree - for source have a look to the google-link in my comment below.

3
  • The example works very well - many thanks! But my more detailled tree - in fact, three trees are joint - still doesn't work. It seems as if the zero-point jumps when I apply "adjust", while the tree keeps its position on the paper. tex-file and pdf on [drive.google.com/drive/folders/…. The result is an A2-output. If I choose A3, the tree will be cut at the right side.
    – P. Nessen
    Commented Apr 20, 2018 at 12:41
  • @P.Nessen You should probably post a separate question for this other, bigger, issue.
    – AML
    Commented Apr 20, 2018 at 13:11
  • solved by work-around: By adding "\usepackage[a3paper,left=-6.9cm,top=2.5cm,bottom=-2.5cm]{geometry}" I got the output I wanted.
    – P. Nessen
    Commented Apr 26, 2018 at 11:23

You must log in to answer this question.

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