Math Help Forum: Trees in LaTeX

  1. #1
    Member Haven's Avatar
    Joined
    Jul 2009
    Posts
    178
    Thanks
    1

    Trees in LaTeX

    I am writing a .tex file that require me to draw some trees but I keep getting errors.

    I'm using the qtree package and I am trying to use the following line

    \Tree [.+ 5 [.+[.* 5 2] [.* 2 4]]]

    but when I compile I get this error:

    Runaway argument?
    ! Paragraph ended before \doanode was complete.
    <to be read again>
    \par

    What am I doing wrong?
    Follow Math Help Forum on Facebook and Google+

  2. Welcome to Math Help Forum - Click here to Register

    Welcome to the largest Math Help Forum, a free community dedicated to math help and math discussions.

    We welcome everyone and the community is free to join so register today and become part of our math family!

  3. #2
    Super Member flyingsquirrel's Avatar
    Joined
    Apr 2008
    Posts
    802
    Quote Originally Posted by Haven View Post
    I'm using the qtree package and I am trying to use the following line

    \Tree [.+ 5 [.+[.* 5 2] [.* 2 4]]]
    Adding extra spaces around each node/subtree solves the problem
    Code:
    \Tree [.+ 5 [.+ [.* 5 2 ] [.* 2 4 ] ] ]
    I am not sure why this is so. Maybe because "Tree labels are delimited by whitespace." (qtree documentation [PDF file], subsection 3.1)

    Also you might want to replace "*" by "$\times$"
    Attached Thumbnails Attached Thumbnails Trees in LaTeX-ex_qtree.gif  
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. How Many Trees?
    Posted in the Pre-Calculus Forum
    Replies: 0
    Last Post: September 12th, 2010, 09:52 PM
  2. Trees
    Posted in the Discrete Math Forum
    Replies: 0
    Last Post: November 21st, 2009, 12:00 PM
  3. LaTex inside of LaTex
    Posted in the LaTeX Help Forum
    Replies: 2
    Last Post: November 12th, 2009, 11:07 AM
  4. how can you plant 10 trees in 5 rows of 4 trees each?
    Posted in the Discrete Math Forum
    Replies: 4
    Last Post: December 22nd, 2008, 11:43 AM
  5. trees
    Posted in the Discrete Math Forum
    Replies: 0
    Last Post: May 22nd, 2007, 09:22 AM

/mathhelpforum @mathhelpforum