How do I make trees with straight skeletons or spines?Making mixed trees with and without text-containing...

A starship is travelling at 0.9c and collides with a small rock. Will it leave a clean hole through, or will more happen?

What is this metal M-shaped device for?

What kind of hardware implements Fourier transform?

What to do when being responsible for data protection in your lab, yet advice is ignored?

Why do neural networks need so many training examples to perform?

Jumping Numbers

Luggage storage for 10 days in Tokyo

How should I handle players who ignore the session zero agreement?

How do you funnel food off a cutting board?

Planet at the end of Solo: A Star Wars Story

Finding radius of circle

Can we use the stored gravitational potential energy of a building to produce power?

What do you call a fact that doesn't match the settings?

How to generate a matrix with certain conditions

Why would the Pakistan airspace closure cancel flights not headed to Pakistan itself?

It took me a lot of time to make this, pls like. (YouTube Comments #1)

Eww, those bytes are gross

Issues with new Macs: hardware makes them difficult to use … what options might be available in the future?

Why zero tolerance on nudity in space?

How can I improve my fireworks photography?

How Internet Communication Works on a Coaxial Cable

Would a National Army of mercenaries be a feasible idea?

Getting a UK passport renewed when you have dual nationality and a different name in your second country?

Word or phrase for showing great skill at something without formal training in it



How do I make trees with straight skeletons or spines?


Making mixed trees with and without text-containing nodesTrees with only leaves in TikZsn edges and nice empty nodes styles in forest lead to dividing by zero; what's going on?How do I draw Phrase Structure Trees in the Style of Heim & Kratzer (1998)?Remove white space from empty nodel label in tikz-qtree?trees with straight spines, and not too much vertical space?How to draw syntactical trees with parallel leaves for a natural language?On syllabic treesHow to create syntactic trees and align them in LaTeX?Straight and non-straight parent-child connections in tikz-qtreeTrees and fitting trees underneath themsquiggly trees in latexPhonological Trees: Consonant Gemination in tikz-qtreeHow to combine bottom-aligned and up-aligned trees?How to make binary search trees in an easy and straight forward way?trees with straight spines, and not too much vertical space?













5















I'm a new/beginner LaTeX user, and I would like to make syntactic trees with straight spines, somewhat like the ones here:



http://tanvirdhaka.blogspot.com/2010/01/phrase-structure-grammar.html



Can this be done with tikz-qtree? That is what I've been using til now.



Edit: Thanks for some of the responses here. I guess I had two questions. The first "problem" is that when I've created a tree, some branches (which have empty nodes or leaves) are uneven (angled) and thus it looks somewhat unsightly. I've included some of my original code to show what I mean. But I think the responses below might help me fix this problem.



documentclass[10pt]{article}

usepackage{tikz}
usepackage{tikz-qtree}

begin{document}

begin{tikzpicture}
Tree % Ugly tree with uneven branches and different lengths
[.CP
[.{} ]
[.C$'$
[.C ]
[.(?)
[.Neg ]
[.TP
[.{} ]
[.T$'$
[.T ]
[.textit{v}P
[.AGENT ]
[.textit{v}$'$
[.textit{v} ]
[.VP
[.V ]
[.THEME ] ] ] ] ] ] ] ] ] ] ] ] ]
end{tikzpicture}

end{document}


The second question I had was how to make a tree with a continuous, straight spine from top to bottom (see second link in my original post above). Does anyone know how to do this?










share|improve this question




















  • 1





    Welcome to TeX SE. What do you have so far? All questions should include a Minimal (non-)Working Example demonstrating both the issue and your efforts to solve it. I would use qtree for this but that's just because I know it. I'm sure tikz-qtree is also fine if that's what you are familiar with. What's the problem?

    – cfr
    Apr 1 '14 at 0:46
















5















I'm a new/beginner LaTeX user, and I would like to make syntactic trees with straight spines, somewhat like the ones here:



http://tanvirdhaka.blogspot.com/2010/01/phrase-structure-grammar.html



Can this be done with tikz-qtree? That is what I've been using til now.



Edit: Thanks for some of the responses here. I guess I had two questions. The first "problem" is that when I've created a tree, some branches (which have empty nodes or leaves) are uneven (angled) and thus it looks somewhat unsightly. I've included some of my original code to show what I mean. But I think the responses below might help me fix this problem.



documentclass[10pt]{article}

usepackage{tikz}
usepackage{tikz-qtree}

begin{document}

begin{tikzpicture}
Tree % Ugly tree with uneven branches and different lengths
[.CP
[.{} ]
[.C$'$
[.C ]
[.(?)
[.Neg ]
[.TP
[.{} ]
[.T$'$
[.T ]
[.textit{v}P
[.AGENT ]
[.textit{v}$'$
[.textit{v} ]
[.VP
[.V ]
[.THEME ] ] ] ] ] ] ] ] ] ] ] ] ]
end{tikzpicture}

end{document}


The second question I had was how to make a tree with a continuous, straight spine from top to bottom (see second link in my original post above). Does anyone know how to do this?










share|improve this question




















  • 1





    Welcome to TeX SE. What do you have so far? All questions should include a Minimal (non-)Working Example demonstrating both the issue and your efforts to solve it. I would use qtree for this but that's just because I know it. I'm sure tikz-qtree is also fine if that's what you are familiar with. What's the problem?

    – cfr
    Apr 1 '14 at 0:46














5












5








5








I'm a new/beginner LaTeX user, and I would like to make syntactic trees with straight spines, somewhat like the ones here:



http://tanvirdhaka.blogspot.com/2010/01/phrase-structure-grammar.html



Can this be done with tikz-qtree? That is what I've been using til now.



Edit: Thanks for some of the responses here. I guess I had two questions. The first "problem" is that when I've created a tree, some branches (which have empty nodes or leaves) are uneven (angled) and thus it looks somewhat unsightly. I've included some of my original code to show what I mean. But I think the responses below might help me fix this problem.



documentclass[10pt]{article}

usepackage{tikz}
usepackage{tikz-qtree}

begin{document}

begin{tikzpicture}
Tree % Ugly tree with uneven branches and different lengths
[.CP
[.{} ]
[.C$'$
[.C ]
[.(?)
[.Neg ]
[.TP
[.{} ]
[.T$'$
[.T ]
[.textit{v}P
[.AGENT ]
[.textit{v}$'$
[.textit{v} ]
[.VP
[.V ]
[.THEME ] ] ] ] ] ] ] ] ] ] ] ] ]
end{tikzpicture}

end{document}


The second question I had was how to make a tree with a continuous, straight spine from top to bottom (see second link in my original post above). Does anyone know how to do this?










share|improve this question
















I'm a new/beginner LaTeX user, and I would like to make syntactic trees with straight spines, somewhat like the ones here:



http://tanvirdhaka.blogspot.com/2010/01/phrase-structure-grammar.html



Can this be done with tikz-qtree? That is what I've been using til now.



Edit: Thanks for some of the responses here. I guess I had two questions. The first "problem" is that when I've created a tree, some branches (which have empty nodes or leaves) are uneven (angled) and thus it looks somewhat unsightly. I've included some of my original code to show what I mean. But I think the responses below might help me fix this problem.



documentclass[10pt]{article}

usepackage{tikz}
usepackage{tikz-qtree}

begin{document}

begin{tikzpicture}
Tree % Ugly tree with uneven branches and different lengths
[.CP
[.{} ]
[.C$'$
[.C ]
[.(?)
[.Neg ]
[.TP
[.{} ]
[.T$'$
[.T ]
[.textit{v}P
[.AGENT ]
[.textit{v}$'$
[.textit{v} ]
[.VP
[.V ]
[.THEME ] ] ] ] ] ] ] ] ] ] ] ] ]
end{tikzpicture}

end{document}


The second question I had was how to make a tree with a continuous, straight spine from top to bottom (see second link in my original post above). Does anyone know how to do this?







linguistics trees tikz-qtree






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 11 mins ago









Stefan Kottwitz

177k64571759




177k64571759










asked Apr 1 '14 at 0:28









MissJMissJ

262




262








  • 1





    Welcome to TeX SE. What do you have so far? All questions should include a Minimal (non-)Working Example demonstrating both the issue and your efforts to solve it. I would use qtree for this but that's just because I know it. I'm sure tikz-qtree is also fine if that's what you are familiar with. What's the problem?

    – cfr
    Apr 1 '14 at 0:46














  • 1





    Welcome to TeX SE. What do you have so far? All questions should include a Minimal (non-)Working Example demonstrating both the issue and your efforts to solve it. I would use qtree for this but that's just because I know it. I'm sure tikz-qtree is also fine if that's what you are familiar with. What's the problem?

    – cfr
    Apr 1 '14 at 0:46








1




1





Welcome to TeX SE. What do you have so far? All questions should include a Minimal (non-)Working Example demonstrating both the issue and your efforts to solve it. I would use qtree for this but that's just because I know it. I'm sure tikz-qtree is also fine if that's what you are familiar with. What's the problem?

– cfr
Apr 1 '14 at 0:46





Welcome to TeX SE. What do you have so far? All questions should include a Minimal (non-)Working Example demonstrating both the issue and your efforts to solve it. I would use qtree for this but that's just because I know it. I'm sure tikz-qtree is also fine if that's what you are familiar with. What's the problem?

– cfr
Apr 1 '14 at 0:46










5 Answers
5






active

oldest

votes


















3














The package forest (which builds on the graphics package tikz-pgf) can be configured as shown below to give you a straight-spined tree with symmetric binary branching. I took the intermediate projection (bar-level) labels out of your MWE to show the straight line through empty nodes as you requested.



enter image description here



documentclass[10pt]{article}

usepackage{tikz}
usepackage{forest}
forestset{sn edges/.style={for tree={parent anchor=south, child anchor=north}}}
forestset{nice empty nodes/.style={for tree={calign=fixed edge angles},
delay={where content={}{shape=coordinate, for parent={for children={anchor=north}}}{}}}}

usepackage{times}

begin{document}

begin{forest}
sn edges, nice empty nodes
[CP
[]
[
[C ]
[(?)
[Neg ]
[TP
[ ]
[
[T ]
[textit{v}P
[AGENT ]
[
[vphantom{V}textit{v} ] % the vphantom{V} makes the height of the little v node the same as the VP node; without it, the branch to the little v goes too low
[VP
[V ]
[THEME ]
]
]
]
]
]
]
]
]
end{forest}

end{document}


The styles sn edges (to get branches that come to a point below the parent node) and nice empty nodes (to get the straight spine and balanced empty nodes) are taken from the forest documentation, but note that with certain fonts, using these styles together can cause errors, as described in my answer to sn edges and nice empty nodes styles in forest lead to dividing by zero.



An alternative way to get straight-spined trees is to make them directly in tikz, as shown in this answer to Making mixed trees with and without text-containing nodes.






share|improve this answer

































    2














    This type of diagram can be created using tikz-qtree by explicitly setting the distance of the leaf-nodes from the root of the tree. A minimum working example for this type of diagram would be:



    documentclass{article}

    usepackage{tikz}
    usepackage{tikz-qtree}

    begin{document}

    % >>> Specify the "frontier"/leaf-level distance from root:
    tikzset{frontier/.style={distance from root=120pt}}

    Tree [.S [.NP [.Det The ]
    [.N Man ] ]
    [.VP [.V captured ]
    [.NP [.Det a ]
    [.N bird ] ] ] ]

    end{document}


    This uses elements described in the tikz-qtree documentation on page 5.



    The result appears as:



    diagram






    share|improve this answer































      2














      This is similar to Jason Zentz's answer, but begins with your original tree and modifies some things further. Like that solution, this uses forest, together with the manual's definition of nice empty nodes (although I implement the idea with a slight variation in coding).



      Implemented with forest, the code for your original tree would be like this:



      begin{forest}
      [CP
      [
      ]
      [C$'$
      [C
      ]
      [(?)
      [Neg
      ]
      [TP
      [
      ]
      [T$'$
      [T
      ]
      [textit{v}P
      [AGENT
      ]
      [textit{v}$'$
      [textit{v}
      ]
      [VP
      [V
      ]
      [THEME
      ]
      ]
      ]
      ]
      ]
      ]
      ]
      ]
      ]
      end{forest}


      which gives us



      tree 1



      Hardly an improvement over the original. If we change the beginning of the tree like this, we can improve it a bit:



      begin{forest}
      for tree={
      parent anchor=south,
      child anchor=north,
      calign=fixed edge angles,
      calign primary angle=-45,
      calign secondary angle=45,
      }
      [CP ...


      This ensures that edges are always drawn from the south anchor of the parent node to the north of the child node, and that the angles between the lines connecting the parent with the leftmost and rightmost children are at constant angles of -45 and 45 degrees respectively. (These angles are measured from the direction of growth which is south by default.)



      tree 2



      There are a couple of issues here: the line to empty nodes is too long and, also, the line to short nodes is too long. The latter is less noticeable, but nonetheless clear when you compare, say, the siblings v and VP.



      We can improve things, although not entirely eliminate the problem, by adding



      align=center,
      base=bottom,


      which will create (potentially) multi-line, tabular nodes with centred columns, and will align siblings by aligning the bottom of these tabulars:



      tree 3



      Now for the code based on nice empty nodes which Jason Zentz used:



      before typesetting nodes={% based on nice empty nodes - page 52 of the manual, used in Jason Zentz's answer: https://tex.stackexchange.com/a/216103/
      if content={}{
      for parent={
      for children={anchor=north},
      },
      shape=coordinate,
      }{},
      },


      which gives us:



      tree 4



      This more-or-less incidentally allows you to draw nice trees with empty nodes with children, provided no node has more than 2 children. For example, a tree specified as



        [
      [
      [
      [A
      ]
      [
      ]
      ]
      [
      ]
      ]
      [
      [
      ]
      [
      [
      ]
      [B
      ]
      ]
      ]
      ]


      will look as follows:



      tree 5



      Complete Code



      Here is the complete code for the final version of your original tree and the demonstration tree above. I've wrapped the modifications into a style nice tree so that you can just say:



      begin{forest}
      nice tree
      [root node ...


      Again, this style will work well for trees where nodes have 0, 1 or 2 children. It will not work well for larger numbers of children, but the trees you are concerned with seem not to require that.



      documentclass[border=5pt, tikz, multi, varwidth]{standalone}
      usepackage{forest}
      standaloneenv{forest}
      begin{document}
      forestset{
      nice tree/.style={
      for tree={
      parent anchor=south,
      child anchor=north,
      calign=fixed edge angles,
      calign primary angle=-45,
      calign secondary angle=45,
      align=center,
      base=bottom,
      before typesetting nodes={% based on nice empty nodes - page 52 of the manual, used in Jason Zentz's answer: https://tex.stackexchange.com/a/216103/
      if content={}{
      for parent={
      for children={anchor=north},
      },
      shape=coordinate,
      }{},
      },
      },
      },
      }
      begin{forest}
      nice tree
      [CP
      [
      ]
      [C$'$
      [C
      ]
      [(?)
      [Neg
      ]
      [TP
      [
      ]
      [T$'$
      [T
      ]
      [textit{v}P
      [AGENT
      ]
      [textit{v}$'$
      [textit{v}
      ]
      [VP
      [V
      ]
      [THEME
      ]
      ]
      ]
      ]
      ]
      ]
      ]
      ]
      ]
      end{forest}
      begin{forest}
      nice tree
      [
      [
      [
      [A
      ]
      [
      ]
      ]
      [
      ]
      ]
      [
      [
      ]
      [
      [
      ]
      [B
      ]
      ]
      ]
      ]
      end{forest}
      end{document}





      share|improve this answer

































        1














        An alternative via tikz



        enter image description here



        Code



        documentclass[border=10pt]{standalone}
        usepackage{tikz}

        begin{document}

        begin{tikzpicture}
        [
        % Children and edges style
        edge from parent/.style={very thick,draw=black!70},
        level 1/.style={sibling distance=5.5cm, growth parent anchor=south,},
        level 2/.style={sibling distance=3.5cm},
        level 3/.style={sibling distance=3.5cm},
        level 4/.style={sibling distance=3.5cm}
        ]
        %% Draw events and edges
        node (g1) [] {S}
        child{node (e1) {NP} % left branch
        child {node (e11) {Det}
        child[level distance=3.25cm]{node{The}}}
        child {node (e13) {N}
        child[level distance=3.25cm]{node{Man}}}
        }
        child {node (e2) {VP} % right branch
        child {node (e21) {V}
        child[level distance=3.25cm]{node( ){captured}}
        }
        child {node (e32) {NP}
        child {node (e11) {Det} child{node(a){a}}}
        child {node (e13) {N} child{node(b) {bird}}}
        }
        };
        end{tikzpicture}





        share|improve this answer



















        • 1





          I think that the lines joining the children of a particular node need to start from a single point under the node to make a kind of upside down 'V' shape. But I might be wrong about this - just that seems to be a common feature of these diagrams.

          – cfr
          Jan 7 '15 at 1:39



















        1














        forest is another option to build syntactic trees. In it's documentation abstract you can read:




        Forest is a pgf/TikZ-based package for drawing linguistic (and other
        kinds of) trees. Its main features are (i) a packing algorithm which
        can produce very compact trees; (ii) a user-friendly interface
        consisting of the familiar bracket encoding of trees plus the
        key–value interface to option- setting; (iii) many tree-formatting
        options, with control over option values of individual nodes and
        mechanisms for their manipulation; (iv) the possibility to decorate
        the tree using the full power of pgf/TikZ; (v) an externalization
        mechanism sensitive to code-changes.




        Previous example typed with forest is:



        documentclass[border=10pt]{standalone}
        usepackage{forest}

        begin{document}
        begin{forest}
        where n children=0{tier=word}{}
        [S
        [NP
        [Det [The]]
        [N [Man]]
        ]
        [VP
        [V [captured]]
        [NP
        [Det [a]]
        [N [bird]]
        ]
        ]
        ]
        end{forest}
        end{document}


        enter image description here






        share|improve this answer























          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "85"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f168807%2fhow-do-i-make-trees-with-straight-skeletons-or-spines%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          5 Answers
          5






          active

          oldest

          votes








          5 Answers
          5






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          3














          The package forest (which builds on the graphics package tikz-pgf) can be configured as shown below to give you a straight-spined tree with symmetric binary branching. I took the intermediate projection (bar-level) labels out of your MWE to show the straight line through empty nodes as you requested.



          enter image description here



          documentclass[10pt]{article}

          usepackage{tikz}
          usepackage{forest}
          forestset{sn edges/.style={for tree={parent anchor=south, child anchor=north}}}
          forestset{nice empty nodes/.style={for tree={calign=fixed edge angles},
          delay={where content={}{shape=coordinate, for parent={for children={anchor=north}}}{}}}}

          usepackage{times}

          begin{document}

          begin{forest}
          sn edges, nice empty nodes
          [CP
          []
          [
          [C ]
          [(?)
          [Neg ]
          [TP
          [ ]
          [
          [T ]
          [textit{v}P
          [AGENT ]
          [
          [vphantom{V}textit{v} ] % the vphantom{V} makes the height of the little v node the same as the VP node; without it, the branch to the little v goes too low
          [VP
          [V ]
          [THEME ]
          ]
          ]
          ]
          ]
          ]
          ]
          ]
          ]
          end{forest}

          end{document}


          The styles sn edges (to get branches that come to a point below the parent node) and nice empty nodes (to get the straight spine and balanced empty nodes) are taken from the forest documentation, but note that with certain fonts, using these styles together can cause errors, as described in my answer to sn edges and nice empty nodes styles in forest lead to dividing by zero.



          An alternative way to get straight-spined trees is to make them directly in tikz, as shown in this answer to Making mixed trees with and without text-containing nodes.






          share|improve this answer






























            3














            The package forest (which builds on the graphics package tikz-pgf) can be configured as shown below to give you a straight-spined tree with symmetric binary branching. I took the intermediate projection (bar-level) labels out of your MWE to show the straight line through empty nodes as you requested.



            enter image description here



            documentclass[10pt]{article}

            usepackage{tikz}
            usepackage{forest}
            forestset{sn edges/.style={for tree={parent anchor=south, child anchor=north}}}
            forestset{nice empty nodes/.style={for tree={calign=fixed edge angles},
            delay={where content={}{shape=coordinate, for parent={for children={anchor=north}}}{}}}}

            usepackage{times}

            begin{document}

            begin{forest}
            sn edges, nice empty nodes
            [CP
            []
            [
            [C ]
            [(?)
            [Neg ]
            [TP
            [ ]
            [
            [T ]
            [textit{v}P
            [AGENT ]
            [
            [vphantom{V}textit{v} ] % the vphantom{V} makes the height of the little v node the same as the VP node; without it, the branch to the little v goes too low
            [VP
            [V ]
            [THEME ]
            ]
            ]
            ]
            ]
            ]
            ]
            ]
            ]
            end{forest}

            end{document}


            The styles sn edges (to get branches that come to a point below the parent node) and nice empty nodes (to get the straight spine and balanced empty nodes) are taken from the forest documentation, but note that with certain fonts, using these styles together can cause errors, as described in my answer to sn edges and nice empty nodes styles in forest lead to dividing by zero.



            An alternative way to get straight-spined trees is to make them directly in tikz, as shown in this answer to Making mixed trees with and without text-containing nodes.






            share|improve this answer




























              3












              3








              3







              The package forest (which builds on the graphics package tikz-pgf) can be configured as shown below to give you a straight-spined tree with symmetric binary branching. I took the intermediate projection (bar-level) labels out of your MWE to show the straight line through empty nodes as you requested.



              enter image description here



              documentclass[10pt]{article}

              usepackage{tikz}
              usepackage{forest}
              forestset{sn edges/.style={for tree={parent anchor=south, child anchor=north}}}
              forestset{nice empty nodes/.style={for tree={calign=fixed edge angles},
              delay={where content={}{shape=coordinate, for parent={for children={anchor=north}}}{}}}}

              usepackage{times}

              begin{document}

              begin{forest}
              sn edges, nice empty nodes
              [CP
              []
              [
              [C ]
              [(?)
              [Neg ]
              [TP
              [ ]
              [
              [T ]
              [textit{v}P
              [AGENT ]
              [
              [vphantom{V}textit{v} ] % the vphantom{V} makes the height of the little v node the same as the VP node; without it, the branch to the little v goes too low
              [VP
              [V ]
              [THEME ]
              ]
              ]
              ]
              ]
              ]
              ]
              ]
              ]
              end{forest}

              end{document}


              The styles sn edges (to get branches that come to a point below the parent node) and nice empty nodes (to get the straight spine and balanced empty nodes) are taken from the forest documentation, but note that with certain fonts, using these styles together can cause errors, as described in my answer to sn edges and nice empty nodes styles in forest lead to dividing by zero.



              An alternative way to get straight-spined trees is to make them directly in tikz, as shown in this answer to Making mixed trees with and without text-containing nodes.






              share|improve this answer















              The package forest (which builds on the graphics package tikz-pgf) can be configured as shown below to give you a straight-spined tree with symmetric binary branching. I took the intermediate projection (bar-level) labels out of your MWE to show the straight line through empty nodes as you requested.



              enter image description here



              documentclass[10pt]{article}

              usepackage{tikz}
              usepackage{forest}
              forestset{sn edges/.style={for tree={parent anchor=south, child anchor=north}}}
              forestset{nice empty nodes/.style={for tree={calign=fixed edge angles},
              delay={where content={}{shape=coordinate, for parent={for children={anchor=north}}}{}}}}

              usepackage{times}

              begin{document}

              begin{forest}
              sn edges, nice empty nodes
              [CP
              []
              [
              [C ]
              [(?)
              [Neg ]
              [TP
              [ ]
              [
              [T ]
              [textit{v}P
              [AGENT ]
              [
              [vphantom{V}textit{v} ] % the vphantom{V} makes the height of the little v node the same as the VP node; without it, the branch to the little v goes too low
              [VP
              [V ]
              [THEME ]
              ]
              ]
              ]
              ]
              ]
              ]
              ]
              ]
              end{forest}

              end{document}


              The styles sn edges (to get branches that come to a point below the parent node) and nice empty nodes (to get the straight spine and balanced empty nodes) are taken from the forest documentation, but note that with certain fonts, using these styles together can cause errors, as described in my answer to sn edges and nice empty nodes styles in forest lead to dividing by zero.



              An alternative way to get straight-spined trees is to make them directly in tikz, as shown in this answer to Making mixed trees with and without text-containing nodes.







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Apr 13 '17 at 12:35









              Community

              1




              1










              answered Dec 9 '14 at 5:07









              Jason ZentzJason Zentz

              3,3771233




              3,3771233























                  2














                  This type of diagram can be created using tikz-qtree by explicitly setting the distance of the leaf-nodes from the root of the tree. A minimum working example for this type of diagram would be:



                  documentclass{article}

                  usepackage{tikz}
                  usepackage{tikz-qtree}

                  begin{document}

                  % >>> Specify the "frontier"/leaf-level distance from root:
                  tikzset{frontier/.style={distance from root=120pt}}

                  Tree [.S [.NP [.Det The ]
                  [.N Man ] ]
                  [.VP [.V captured ]
                  [.NP [.Det a ]
                  [.N bird ] ] ] ]

                  end{document}


                  This uses elements described in the tikz-qtree documentation on page 5.



                  The result appears as:



                  diagram






                  share|improve this answer




























                    2














                    This type of diagram can be created using tikz-qtree by explicitly setting the distance of the leaf-nodes from the root of the tree. A minimum working example for this type of diagram would be:



                    documentclass{article}

                    usepackage{tikz}
                    usepackage{tikz-qtree}

                    begin{document}

                    % >>> Specify the "frontier"/leaf-level distance from root:
                    tikzset{frontier/.style={distance from root=120pt}}

                    Tree [.S [.NP [.Det The ]
                    [.N Man ] ]
                    [.VP [.V captured ]
                    [.NP [.Det a ]
                    [.N bird ] ] ] ]

                    end{document}


                    This uses elements described in the tikz-qtree documentation on page 5.



                    The result appears as:



                    diagram






                    share|improve this answer


























                      2












                      2








                      2







                      This type of diagram can be created using tikz-qtree by explicitly setting the distance of the leaf-nodes from the root of the tree. A minimum working example for this type of diagram would be:



                      documentclass{article}

                      usepackage{tikz}
                      usepackage{tikz-qtree}

                      begin{document}

                      % >>> Specify the "frontier"/leaf-level distance from root:
                      tikzset{frontier/.style={distance from root=120pt}}

                      Tree [.S [.NP [.Det The ]
                      [.N Man ] ]
                      [.VP [.V captured ]
                      [.NP [.Det a ]
                      [.N bird ] ] ] ]

                      end{document}


                      This uses elements described in the tikz-qtree documentation on page 5.



                      The result appears as:



                      diagram






                      share|improve this answer













                      This type of diagram can be created using tikz-qtree by explicitly setting the distance of the leaf-nodes from the root of the tree. A minimum working example for this type of diagram would be:



                      documentclass{article}

                      usepackage{tikz}
                      usepackage{tikz-qtree}

                      begin{document}

                      % >>> Specify the "frontier"/leaf-level distance from root:
                      tikzset{frontier/.style={distance from root=120pt}}

                      Tree [.S [.NP [.Det The ]
                      [.N Man ] ]
                      [.VP [.V captured ]
                      [.NP [.Det a ]
                      [.N bird ] ] ] ]

                      end{document}


                      This uses elements described in the tikz-qtree documentation on page 5.



                      The result appears as:



                      diagram







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Apr 1 '14 at 3:07









                      cslstrcslstr

                      5,09511447




                      5,09511447























                          2














                          This is similar to Jason Zentz's answer, but begins with your original tree and modifies some things further. Like that solution, this uses forest, together with the manual's definition of nice empty nodes (although I implement the idea with a slight variation in coding).



                          Implemented with forest, the code for your original tree would be like this:



                          begin{forest}
                          [CP
                          [
                          ]
                          [C$'$
                          [C
                          ]
                          [(?)
                          [Neg
                          ]
                          [TP
                          [
                          ]
                          [T$'$
                          [T
                          ]
                          [textit{v}P
                          [AGENT
                          ]
                          [textit{v}$'$
                          [textit{v}
                          ]
                          [VP
                          [V
                          ]
                          [THEME
                          ]
                          ]
                          ]
                          ]
                          ]
                          ]
                          ]
                          ]
                          ]
                          end{forest}


                          which gives us



                          tree 1



                          Hardly an improvement over the original. If we change the beginning of the tree like this, we can improve it a bit:



                          begin{forest}
                          for tree={
                          parent anchor=south,
                          child anchor=north,
                          calign=fixed edge angles,
                          calign primary angle=-45,
                          calign secondary angle=45,
                          }
                          [CP ...


                          This ensures that edges are always drawn from the south anchor of the parent node to the north of the child node, and that the angles between the lines connecting the parent with the leftmost and rightmost children are at constant angles of -45 and 45 degrees respectively. (These angles are measured from the direction of growth which is south by default.)



                          tree 2



                          There are a couple of issues here: the line to empty nodes is too long and, also, the line to short nodes is too long. The latter is less noticeable, but nonetheless clear when you compare, say, the siblings v and VP.



                          We can improve things, although not entirely eliminate the problem, by adding



                          align=center,
                          base=bottom,


                          which will create (potentially) multi-line, tabular nodes with centred columns, and will align siblings by aligning the bottom of these tabulars:



                          tree 3



                          Now for the code based on nice empty nodes which Jason Zentz used:



                          before typesetting nodes={% based on nice empty nodes - page 52 of the manual, used in Jason Zentz's answer: https://tex.stackexchange.com/a/216103/
                          if content={}{
                          for parent={
                          for children={anchor=north},
                          },
                          shape=coordinate,
                          }{},
                          },


                          which gives us:



                          tree 4



                          This more-or-less incidentally allows you to draw nice trees with empty nodes with children, provided no node has more than 2 children. For example, a tree specified as



                            [
                          [
                          [
                          [A
                          ]
                          [
                          ]
                          ]
                          [
                          ]
                          ]
                          [
                          [
                          ]
                          [
                          [
                          ]
                          [B
                          ]
                          ]
                          ]
                          ]


                          will look as follows:



                          tree 5



                          Complete Code



                          Here is the complete code for the final version of your original tree and the demonstration tree above. I've wrapped the modifications into a style nice tree so that you can just say:



                          begin{forest}
                          nice tree
                          [root node ...


                          Again, this style will work well for trees where nodes have 0, 1 or 2 children. It will not work well for larger numbers of children, but the trees you are concerned with seem not to require that.



                          documentclass[border=5pt, tikz, multi, varwidth]{standalone}
                          usepackage{forest}
                          standaloneenv{forest}
                          begin{document}
                          forestset{
                          nice tree/.style={
                          for tree={
                          parent anchor=south,
                          child anchor=north,
                          calign=fixed edge angles,
                          calign primary angle=-45,
                          calign secondary angle=45,
                          align=center,
                          base=bottom,
                          before typesetting nodes={% based on nice empty nodes - page 52 of the manual, used in Jason Zentz's answer: https://tex.stackexchange.com/a/216103/
                          if content={}{
                          for parent={
                          for children={anchor=north},
                          },
                          shape=coordinate,
                          }{},
                          },
                          },
                          },
                          }
                          begin{forest}
                          nice tree
                          [CP
                          [
                          ]
                          [C$'$
                          [C
                          ]
                          [(?)
                          [Neg
                          ]
                          [TP
                          [
                          ]
                          [T$'$
                          [T
                          ]
                          [textit{v}P
                          [AGENT
                          ]
                          [textit{v}$'$
                          [textit{v}
                          ]
                          [VP
                          [V
                          ]
                          [THEME
                          ]
                          ]
                          ]
                          ]
                          ]
                          ]
                          ]
                          ]
                          ]
                          end{forest}
                          begin{forest}
                          nice tree
                          [
                          [
                          [
                          [A
                          ]
                          [
                          ]
                          ]
                          [
                          ]
                          ]
                          [
                          [
                          ]
                          [
                          [
                          ]
                          [B
                          ]
                          ]
                          ]
                          ]
                          end{forest}
                          end{document}





                          share|improve this answer






























                            2














                            This is similar to Jason Zentz's answer, but begins with your original tree and modifies some things further. Like that solution, this uses forest, together with the manual's definition of nice empty nodes (although I implement the idea with a slight variation in coding).



                            Implemented with forest, the code for your original tree would be like this:



                            begin{forest}
                            [CP
                            [
                            ]
                            [C$'$
                            [C
                            ]
                            [(?)
                            [Neg
                            ]
                            [TP
                            [
                            ]
                            [T$'$
                            [T
                            ]
                            [textit{v}P
                            [AGENT
                            ]
                            [textit{v}$'$
                            [textit{v}
                            ]
                            [VP
                            [V
                            ]
                            [THEME
                            ]
                            ]
                            ]
                            ]
                            ]
                            ]
                            ]
                            ]
                            ]
                            end{forest}


                            which gives us



                            tree 1



                            Hardly an improvement over the original. If we change the beginning of the tree like this, we can improve it a bit:



                            begin{forest}
                            for tree={
                            parent anchor=south,
                            child anchor=north,
                            calign=fixed edge angles,
                            calign primary angle=-45,
                            calign secondary angle=45,
                            }
                            [CP ...


                            This ensures that edges are always drawn from the south anchor of the parent node to the north of the child node, and that the angles between the lines connecting the parent with the leftmost and rightmost children are at constant angles of -45 and 45 degrees respectively. (These angles are measured from the direction of growth which is south by default.)



                            tree 2



                            There are a couple of issues here: the line to empty nodes is too long and, also, the line to short nodes is too long. The latter is less noticeable, but nonetheless clear when you compare, say, the siblings v and VP.



                            We can improve things, although not entirely eliminate the problem, by adding



                            align=center,
                            base=bottom,


                            which will create (potentially) multi-line, tabular nodes with centred columns, and will align siblings by aligning the bottom of these tabulars:



                            tree 3



                            Now for the code based on nice empty nodes which Jason Zentz used:



                            before typesetting nodes={% based on nice empty nodes - page 52 of the manual, used in Jason Zentz's answer: https://tex.stackexchange.com/a/216103/
                            if content={}{
                            for parent={
                            for children={anchor=north},
                            },
                            shape=coordinate,
                            }{},
                            },


                            which gives us:



                            tree 4



                            This more-or-less incidentally allows you to draw nice trees with empty nodes with children, provided no node has more than 2 children. For example, a tree specified as



                              [
                            [
                            [
                            [A
                            ]
                            [
                            ]
                            ]
                            [
                            ]
                            ]
                            [
                            [
                            ]
                            [
                            [
                            ]
                            [B
                            ]
                            ]
                            ]
                            ]


                            will look as follows:



                            tree 5



                            Complete Code



                            Here is the complete code for the final version of your original tree and the demonstration tree above. I've wrapped the modifications into a style nice tree so that you can just say:



                            begin{forest}
                            nice tree
                            [root node ...


                            Again, this style will work well for trees where nodes have 0, 1 or 2 children. It will not work well for larger numbers of children, but the trees you are concerned with seem not to require that.



                            documentclass[border=5pt, tikz, multi, varwidth]{standalone}
                            usepackage{forest}
                            standaloneenv{forest}
                            begin{document}
                            forestset{
                            nice tree/.style={
                            for tree={
                            parent anchor=south,
                            child anchor=north,
                            calign=fixed edge angles,
                            calign primary angle=-45,
                            calign secondary angle=45,
                            align=center,
                            base=bottom,
                            before typesetting nodes={% based on nice empty nodes - page 52 of the manual, used in Jason Zentz's answer: https://tex.stackexchange.com/a/216103/
                            if content={}{
                            for parent={
                            for children={anchor=north},
                            },
                            shape=coordinate,
                            }{},
                            },
                            },
                            },
                            }
                            begin{forest}
                            nice tree
                            [CP
                            [
                            ]
                            [C$'$
                            [C
                            ]
                            [(?)
                            [Neg
                            ]
                            [TP
                            [
                            ]
                            [T$'$
                            [T
                            ]
                            [textit{v}P
                            [AGENT
                            ]
                            [textit{v}$'$
                            [textit{v}
                            ]
                            [VP
                            [V
                            ]
                            [THEME
                            ]
                            ]
                            ]
                            ]
                            ]
                            ]
                            ]
                            ]
                            ]
                            end{forest}
                            begin{forest}
                            nice tree
                            [
                            [
                            [
                            [A
                            ]
                            [
                            ]
                            ]
                            [
                            ]
                            ]
                            [
                            [
                            ]
                            [
                            [
                            ]
                            [B
                            ]
                            ]
                            ]
                            ]
                            end{forest}
                            end{document}





                            share|improve this answer




























                              2












                              2








                              2







                              This is similar to Jason Zentz's answer, but begins with your original tree and modifies some things further. Like that solution, this uses forest, together with the manual's definition of nice empty nodes (although I implement the idea with a slight variation in coding).



                              Implemented with forest, the code for your original tree would be like this:



                              begin{forest}
                              [CP
                              [
                              ]
                              [C$'$
                              [C
                              ]
                              [(?)
                              [Neg
                              ]
                              [TP
                              [
                              ]
                              [T$'$
                              [T
                              ]
                              [textit{v}P
                              [AGENT
                              ]
                              [textit{v}$'$
                              [textit{v}
                              ]
                              [VP
                              [V
                              ]
                              [THEME
                              ]
                              ]
                              ]
                              ]
                              ]
                              ]
                              ]
                              ]
                              ]
                              end{forest}


                              which gives us



                              tree 1



                              Hardly an improvement over the original. If we change the beginning of the tree like this, we can improve it a bit:



                              begin{forest}
                              for tree={
                              parent anchor=south,
                              child anchor=north,
                              calign=fixed edge angles,
                              calign primary angle=-45,
                              calign secondary angle=45,
                              }
                              [CP ...


                              This ensures that edges are always drawn from the south anchor of the parent node to the north of the child node, and that the angles between the lines connecting the parent with the leftmost and rightmost children are at constant angles of -45 and 45 degrees respectively. (These angles are measured from the direction of growth which is south by default.)



                              tree 2



                              There are a couple of issues here: the line to empty nodes is too long and, also, the line to short nodes is too long. The latter is less noticeable, but nonetheless clear when you compare, say, the siblings v and VP.



                              We can improve things, although not entirely eliminate the problem, by adding



                              align=center,
                              base=bottom,


                              which will create (potentially) multi-line, tabular nodes with centred columns, and will align siblings by aligning the bottom of these tabulars:



                              tree 3



                              Now for the code based on nice empty nodes which Jason Zentz used:



                              before typesetting nodes={% based on nice empty nodes - page 52 of the manual, used in Jason Zentz's answer: https://tex.stackexchange.com/a/216103/
                              if content={}{
                              for parent={
                              for children={anchor=north},
                              },
                              shape=coordinate,
                              }{},
                              },


                              which gives us:



                              tree 4



                              This more-or-less incidentally allows you to draw nice trees with empty nodes with children, provided no node has more than 2 children. For example, a tree specified as



                                [
                              [
                              [
                              [A
                              ]
                              [
                              ]
                              ]
                              [
                              ]
                              ]
                              [
                              [
                              ]
                              [
                              [
                              ]
                              [B
                              ]
                              ]
                              ]
                              ]


                              will look as follows:



                              tree 5



                              Complete Code



                              Here is the complete code for the final version of your original tree and the demonstration tree above. I've wrapped the modifications into a style nice tree so that you can just say:



                              begin{forest}
                              nice tree
                              [root node ...


                              Again, this style will work well for trees where nodes have 0, 1 or 2 children. It will not work well for larger numbers of children, but the trees you are concerned with seem not to require that.



                              documentclass[border=5pt, tikz, multi, varwidth]{standalone}
                              usepackage{forest}
                              standaloneenv{forest}
                              begin{document}
                              forestset{
                              nice tree/.style={
                              for tree={
                              parent anchor=south,
                              child anchor=north,
                              calign=fixed edge angles,
                              calign primary angle=-45,
                              calign secondary angle=45,
                              align=center,
                              base=bottom,
                              before typesetting nodes={% based on nice empty nodes - page 52 of the manual, used in Jason Zentz's answer: https://tex.stackexchange.com/a/216103/
                              if content={}{
                              for parent={
                              for children={anchor=north},
                              },
                              shape=coordinate,
                              }{},
                              },
                              },
                              },
                              }
                              begin{forest}
                              nice tree
                              [CP
                              [
                              ]
                              [C$'$
                              [C
                              ]
                              [(?)
                              [Neg
                              ]
                              [TP
                              [
                              ]
                              [T$'$
                              [T
                              ]
                              [textit{v}P
                              [AGENT
                              ]
                              [textit{v}$'$
                              [textit{v}
                              ]
                              [VP
                              [V
                              ]
                              [THEME
                              ]
                              ]
                              ]
                              ]
                              ]
                              ]
                              ]
                              ]
                              ]
                              end{forest}
                              begin{forest}
                              nice tree
                              [
                              [
                              [
                              [A
                              ]
                              [
                              ]
                              ]
                              [
                              ]
                              ]
                              [
                              [
                              ]
                              [
                              [
                              ]
                              [B
                              ]
                              ]
                              ]
                              ]
                              end{forest}
                              end{document}





                              share|improve this answer















                              This is similar to Jason Zentz's answer, but begins with your original tree and modifies some things further. Like that solution, this uses forest, together with the manual's definition of nice empty nodes (although I implement the idea with a slight variation in coding).



                              Implemented with forest, the code for your original tree would be like this:



                              begin{forest}
                              [CP
                              [
                              ]
                              [C$'$
                              [C
                              ]
                              [(?)
                              [Neg
                              ]
                              [TP
                              [
                              ]
                              [T$'$
                              [T
                              ]
                              [textit{v}P
                              [AGENT
                              ]
                              [textit{v}$'$
                              [textit{v}
                              ]
                              [VP
                              [V
                              ]
                              [THEME
                              ]
                              ]
                              ]
                              ]
                              ]
                              ]
                              ]
                              ]
                              ]
                              end{forest}


                              which gives us



                              tree 1



                              Hardly an improvement over the original. If we change the beginning of the tree like this, we can improve it a bit:



                              begin{forest}
                              for tree={
                              parent anchor=south,
                              child anchor=north,
                              calign=fixed edge angles,
                              calign primary angle=-45,
                              calign secondary angle=45,
                              }
                              [CP ...


                              This ensures that edges are always drawn from the south anchor of the parent node to the north of the child node, and that the angles between the lines connecting the parent with the leftmost and rightmost children are at constant angles of -45 and 45 degrees respectively. (These angles are measured from the direction of growth which is south by default.)



                              tree 2



                              There are a couple of issues here: the line to empty nodes is too long and, also, the line to short nodes is too long. The latter is less noticeable, but nonetheless clear when you compare, say, the siblings v and VP.



                              We can improve things, although not entirely eliminate the problem, by adding



                              align=center,
                              base=bottom,


                              which will create (potentially) multi-line, tabular nodes with centred columns, and will align siblings by aligning the bottom of these tabulars:



                              tree 3



                              Now for the code based on nice empty nodes which Jason Zentz used:



                              before typesetting nodes={% based on nice empty nodes - page 52 of the manual, used in Jason Zentz's answer: https://tex.stackexchange.com/a/216103/
                              if content={}{
                              for parent={
                              for children={anchor=north},
                              },
                              shape=coordinate,
                              }{},
                              },


                              which gives us:



                              tree 4



                              This more-or-less incidentally allows you to draw nice trees with empty nodes with children, provided no node has more than 2 children. For example, a tree specified as



                                [
                              [
                              [
                              [A
                              ]
                              [
                              ]
                              ]
                              [
                              ]
                              ]
                              [
                              [
                              ]
                              [
                              [
                              ]
                              [B
                              ]
                              ]
                              ]
                              ]


                              will look as follows:



                              tree 5



                              Complete Code



                              Here is the complete code for the final version of your original tree and the demonstration tree above. I've wrapped the modifications into a style nice tree so that you can just say:



                              begin{forest}
                              nice tree
                              [root node ...


                              Again, this style will work well for trees where nodes have 0, 1 or 2 children. It will not work well for larger numbers of children, but the trees you are concerned with seem not to require that.



                              documentclass[border=5pt, tikz, multi, varwidth]{standalone}
                              usepackage{forest}
                              standaloneenv{forest}
                              begin{document}
                              forestset{
                              nice tree/.style={
                              for tree={
                              parent anchor=south,
                              child anchor=north,
                              calign=fixed edge angles,
                              calign primary angle=-45,
                              calign secondary angle=45,
                              align=center,
                              base=bottom,
                              before typesetting nodes={% based on nice empty nodes - page 52 of the manual, used in Jason Zentz's answer: https://tex.stackexchange.com/a/216103/
                              if content={}{
                              for parent={
                              for children={anchor=north},
                              },
                              shape=coordinate,
                              }{},
                              },
                              },
                              },
                              }
                              begin{forest}
                              nice tree
                              [CP
                              [
                              ]
                              [C$'$
                              [C
                              ]
                              [(?)
                              [Neg
                              ]
                              [TP
                              [
                              ]
                              [T$'$
                              [T
                              ]
                              [textit{v}P
                              [AGENT
                              ]
                              [textit{v}$'$
                              [textit{v}
                              ]
                              [VP
                              [V
                              ]
                              [THEME
                              ]
                              ]
                              ]
                              ]
                              ]
                              ]
                              ]
                              ]
                              ]
                              end{forest}
                              begin{forest}
                              nice tree
                              [
                              [
                              [
                              [A
                              ]
                              [
                              ]
                              ]
                              [
                              ]
                              ]
                              [
                              [
                              ]
                              [
                              [
                              ]
                              [B
                              ]
                              ]
                              ]
                              ]
                              end{forest}
                              end{document}






                              share|improve this answer














                              share|improve this answer



                              share|improve this answer








                              edited Apr 13 '17 at 12:35









                              Community

                              1




                              1










                              answered Jan 7 '15 at 1:37









                              cfrcfr

                              157k8191390




                              157k8191390























                                  1














                                  An alternative via tikz



                                  enter image description here



                                  Code



                                  documentclass[border=10pt]{standalone}
                                  usepackage{tikz}

                                  begin{document}

                                  begin{tikzpicture}
                                  [
                                  % Children and edges style
                                  edge from parent/.style={very thick,draw=black!70},
                                  level 1/.style={sibling distance=5.5cm, growth parent anchor=south,},
                                  level 2/.style={sibling distance=3.5cm},
                                  level 3/.style={sibling distance=3.5cm},
                                  level 4/.style={sibling distance=3.5cm}
                                  ]
                                  %% Draw events and edges
                                  node (g1) [] {S}
                                  child{node (e1) {NP} % left branch
                                  child {node (e11) {Det}
                                  child[level distance=3.25cm]{node{The}}}
                                  child {node (e13) {N}
                                  child[level distance=3.25cm]{node{Man}}}
                                  }
                                  child {node (e2) {VP} % right branch
                                  child {node (e21) {V}
                                  child[level distance=3.25cm]{node( ){captured}}
                                  }
                                  child {node (e32) {NP}
                                  child {node (e11) {Det} child{node(a){a}}}
                                  child {node (e13) {N} child{node(b) {bird}}}
                                  }
                                  };
                                  end{tikzpicture}





                                  share|improve this answer



















                                  • 1





                                    I think that the lines joining the children of a particular node need to start from a single point under the node to make a kind of upside down 'V' shape. But I might be wrong about this - just that seems to be a common feature of these diagrams.

                                    – cfr
                                    Jan 7 '15 at 1:39
















                                  1














                                  An alternative via tikz



                                  enter image description here



                                  Code



                                  documentclass[border=10pt]{standalone}
                                  usepackage{tikz}

                                  begin{document}

                                  begin{tikzpicture}
                                  [
                                  % Children and edges style
                                  edge from parent/.style={very thick,draw=black!70},
                                  level 1/.style={sibling distance=5.5cm, growth parent anchor=south,},
                                  level 2/.style={sibling distance=3.5cm},
                                  level 3/.style={sibling distance=3.5cm},
                                  level 4/.style={sibling distance=3.5cm}
                                  ]
                                  %% Draw events and edges
                                  node (g1) [] {S}
                                  child{node (e1) {NP} % left branch
                                  child {node (e11) {Det}
                                  child[level distance=3.25cm]{node{The}}}
                                  child {node (e13) {N}
                                  child[level distance=3.25cm]{node{Man}}}
                                  }
                                  child {node (e2) {VP} % right branch
                                  child {node (e21) {V}
                                  child[level distance=3.25cm]{node( ){captured}}
                                  }
                                  child {node (e32) {NP}
                                  child {node (e11) {Det} child{node(a){a}}}
                                  child {node (e13) {N} child{node(b) {bird}}}
                                  }
                                  };
                                  end{tikzpicture}





                                  share|improve this answer



















                                  • 1





                                    I think that the lines joining the children of a particular node need to start from a single point under the node to make a kind of upside down 'V' shape. But I might be wrong about this - just that seems to be a common feature of these diagrams.

                                    – cfr
                                    Jan 7 '15 at 1:39














                                  1












                                  1








                                  1







                                  An alternative via tikz



                                  enter image description here



                                  Code



                                  documentclass[border=10pt]{standalone}
                                  usepackage{tikz}

                                  begin{document}

                                  begin{tikzpicture}
                                  [
                                  % Children and edges style
                                  edge from parent/.style={very thick,draw=black!70},
                                  level 1/.style={sibling distance=5.5cm, growth parent anchor=south,},
                                  level 2/.style={sibling distance=3.5cm},
                                  level 3/.style={sibling distance=3.5cm},
                                  level 4/.style={sibling distance=3.5cm}
                                  ]
                                  %% Draw events and edges
                                  node (g1) [] {S}
                                  child{node (e1) {NP} % left branch
                                  child {node (e11) {Det}
                                  child[level distance=3.25cm]{node{The}}}
                                  child {node (e13) {N}
                                  child[level distance=3.25cm]{node{Man}}}
                                  }
                                  child {node (e2) {VP} % right branch
                                  child {node (e21) {V}
                                  child[level distance=3.25cm]{node( ){captured}}
                                  }
                                  child {node (e32) {NP}
                                  child {node (e11) {Det} child{node(a){a}}}
                                  child {node (e13) {N} child{node(b) {bird}}}
                                  }
                                  };
                                  end{tikzpicture}





                                  share|improve this answer













                                  An alternative via tikz



                                  enter image description here



                                  Code



                                  documentclass[border=10pt]{standalone}
                                  usepackage{tikz}

                                  begin{document}

                                  begin{tikzpicture}
                                  [
                                  % Children and edges style
                                  edge from parent/.style={very thick,draw=black!70},
                                  level 1/.style={sibling distance=5.5cm, growth parent anchor=south,},
                                  level 2/.style={sibling distance=3.5cm},
                                  level 3/.style={sibling distance=3.5cm},
                                  level 4/.style={sibling distance=3.5cm}
                                  ]
                                  %% Draw events and edges
                                  node (g1) [] {S}
                                  child{node (e1) {NP} % left branch
                                  child {node (e11) {Det}
                                  child[level distance=3.25cm]{node{The}}}
                                  child {node (e13) {N}
                                  child[level distance=3.25cm]{node{Man}}}
                                  }
                                  child {node (e2) {VP} % right branch
                                  child {node (e21) {V}
                                  child[level distance=3.25cm]{node( ){captured}}
                                  }
                                  child {node (e32) {NP}
                                  child {node (e11) {Det} child{node(a){a}}}
                                  child {node (e13) {N} child{node(b) {bird}}}
                                  }
                                  };
                                  end{tikzpicture}






                                  share|improve this answer












                                  share|improve this answer



                                  share|improve this answer










                                  answered Apr 1 '14 at 7:26









                                  JesseJesse

                                  26.3k72679




                                  26.3k72679








                                  • 1





                                    I think that the lines joining the children of a particular node need to start from a single point under the node to make a kind of upside down 'V' shape. But I might be wrong about this - just that seems to be a common feature of these diagrams.

                                    – cfr
                                    Jan 7 '15 at 1:39














                                  • 1





                                    I think that the lines joining the children of a particular node need to start from a single point under the node to make a kind of upside down 'V' shape. But I might be wrong about this - just that seems to be a common feature of these diagrams.

                                    – cfr
                                    Jan 7 '15 at 1:39








                                  1




                                  1





                                  I think that the lines joining the children of a particular node need to start from a single point under the node to make a kind of upside down 'V' shape. But I might be wrong about this - just that seems to be a common feature of these diagrams.

                                  – cfr
                                  Jan 7 '15 at 1:39





                                  I think that the lines joining the children of a particular node need to start from a single point under the node to make a kind of upside down 'V' shape. But I might be wrong about this - just that seems to be a common feature of these diagrams.

                                  – cfr
                                  Jan 7 '15 at 1:39











                                  1














                                  forest is another option to build syntactic trees. In it's documentation abstract you can read:




                                  Forest is a pgf/TikZ-based package for drawing linguistic (and other
                                  kinds of) trees. Its main features are (i) a packing algorithm which
                                  can produce very compact trees; (ii) a user-friendly interface
                                  consisting of the familiar bracket encoding of trees plus the
                                  key–value interface to option- setting; (iii) many tree-formatting
                                  options, with control over option values of individual nodes and
                                  mechanisms for their manipulation; (iv) the possibility to decorate
                                  the tree using the full power of pgf/TikZ; (v) an externalization
                                  mechanism sensitive to code-changes.




                                  Previous example typed with forest is:



                                  documentclass[border=10pt]{standalone}
                                  usepackage{forest}

                                  begin{document}
                                  begin{forest}
                                  where n children=0{tier=word}{}
                                  [S
                                  [NP
                                  [Det [The]]
                                  [N [Man]]
                                  ]
                                  [VP
                                  [V [captured]]
                                  [NP
                                  [Det [a]]
                                  [N [bird]]
                                  ]
                                  ]
                                  ]
                                  end{forest}
                                  end{document}


                                  enter image description here






                                  share|improve this answer




























                                    1














                                    forest is another option to build syntactic trees. In it's documentation abstract you can read:




                                    Forest is a pgf/TikZ-based package for drawing linguistic (and other
                                    kinds of) trees. Its main features are (i) a packing algorithm which
                                    can produce very compact trees; (ii) a user-friendly interface
                                    consisting of the familiar bracket encoding of trees plus the
                                    key–value interface to option- setting; (iii) many tree-formatting
                                    options, with control over option values of individual nodes and
                                    mechanisms for their manipulation; (iv) the possibility to decorate
                                    the tree using the full power of pgf/TikZ; (v) an externalization
                                    mechanism sensitive to code-changes.




                                    Previous example typed with forest is:



                                    documentclass[border=10pt]{standalone}
                                    usepackage{forest}

                                    begin{document}
                                    begin{forest}
                                    where n children=0{tier=word}{}
                                    [S
                                    [NP
                                    [Det [The]]
                                    [N [Man]]
                                    ]
                                    [VP
                                    [V [captured]]
                                    [NP
                                    [Det [a]]
                                    [N [bird]]
                                    ]
                                    ]
                                    ]
                                    end{forest}
                                    end{document}


                                    enter image description here






                                    share|improve this answer


























                                      1












                                      1








                                      1







                                      forest is another option to build syntactic trees. In it's documentation abstract you can read:




                                      Forest is a pgf/TikZ-based package for drawing linguistic (and other
                                      kinds of) trees. Its main features are (i) a packing algorithm which
                                      can produce very compact trees; (ii) a user-friendly interface
                                      consisting of the familiar bracket encoding of trees plus the
                                      key–value interface to option- setting; (iii) many tree-formatting
                                      options, with control over option values of individual nodes and
                                      mechanisms for their manipulation; (iv) the possibility to decorate
                                      the tree using the full power of pgf/TikZ; (v) an externalization
                                      mechanism sensitive to code-changes.




                                      Previous example typed with forest is:



                                      documentclass[border=10pt]{standalone}
                                      usepackage{forest}

                                      begin{document}
                                      begin{forest}
                                      where n children=0{tier=word}{}
                                      [S
                                      [NP
                                      [Det [The]]
                                      [N [Man]]
                                      ]
                                      [VP
                                      [V [captured]]
                                      [NP
                                      [Det [a]]
                                      [N [bird]]
                                      ]
                                      ]
                                      ]
                                      end{forest}
                                      end{document}


                                      enter image description here






                                      share|improve this answer













                                      forest is another option to build syntactic trees. In it's documentation abstract you can read:




                                      Forest is a pgf/TikZ-based package for drawing linguistic (and other
                                      kinds of) trees. Its main features are (i) a packing algorithm which
                                      can produce very compact trees; (ii) a user-friendly interface
                                      consisting of the familiar bracket encoding of trees plus the
                                      key–value interface to option- setting; (iii) many tree-formatting
                                      options, with control over option values of individual nodes and
                                      mechanisms for their manipulation; (iv) the possibility to decorate
                                      the tree using the full power of pgf/TikZ; (v) an externalization
                                      mechanism sensitive to code-changes.




                                      Previous example typed with forest is:



                                      documentclass[border=10pt]{standalone}
                                      usepackage{forest}

                                      begin{document}
                                      begin{forest}
                                      where n children=0{tier=word}{}
                                      [S
                                      [NP
                                      [Det [The]]
                                      [N [Man]]
                                      ]
                                      [VP
                                      [V [captured]]
                                      [NP
                                      [Det [a]]
                                      [N [bird]]
                                      ]
                                      ]
                                      ]
                                      end{forest}
                                      end{document}


                                      enter image description here







                                      share|improve this answer












                                      share|improve this answer



                                      share|improve this answer










                                      answered Apr 1 '14 at 8:40









                                      IgnasiIgnasi

                                      93.8k4169311




                                      93.8k4169311






























                                          draft saved

                                          draft discarded




















































                                          Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


                                          • Please be sure to answer the question. Provide details and share your research!

                                          But avoid



                                          • Asking for help, clarification, or responding to other answers.

                                          • Making statements based on opinion; back them up with references or personal experience.


                                          To learn more, see our tips on writing great answers.




                                          draft saved


                                          draft discarded














                                          StackExchange.ready(
                                          function () {
                                          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f168807%2fhow-do-i-make-trees-with-straight-skeletons-or-spines%23new-answer', 'question_page');
                                          }
                                          );

                                          Post as a guest















                                          Required, but never shown





















































                                          Required, but never shown














                                          Required, but never shown












                                          Required, but never shown







                                          Required, but never shown

































                                          Required, but never shown














                                          Required, but never shown












                                          Required, but never shown







                                          Required, but never shown







                                          Popular posts from this blog

                                          IEEEtran - How to include ORCID in TeX/PDF with PdfLatexIs there a standard way to include ORCID in TeX /...

                                          Cicindela nigrior Przypisy | Menu nawigacyjneCicindela varians unicolorManual for the Identification of the...

                                          Glossaries-extra: Adding glossaries package to “Clas­sicTh­e­sis” template by Dr. André Miede v. 4.6 ...