0

I want to make tree strucrure. I seacrch a lot, but found other structure's solution. But did not solution find fortree. Suggest me tutorial or give me solution here. Help me!

Manpreet Dhiman
  • 341
  • 1
  • 4
  • 14
  • 2
    In all of the many tree questions on the site surely you can find one that comes close? Then post a minimal example document showing what you've done and what you need help with. I would recommend using the forest package. – Alan Munn Jul 05 '17 at 16:31
  • 2
    For example: Square edges in forest package. Simply adding -> to the \path options will give you the format above. – Alan Munn Jul 05 '17 at 16:37
  • 1
    @AlanMunn I agree with your comments generally, of course, but that is not a good example with Forest. First, it uses internal macros for no reason, rather than the end-user wrappers the author recommends and supports. Second, it doesn't do it the easy way for current Forest. – cfr Jul 05 '17 at 22:21
  • @cfr Yeah, I did a quick search and found that one. Of course I should have found one of your answers. (Perhaps you can add one to the linked question too.) – Alan Munn Jul 05 '17 at 22:25
  • @AlanMunn That is not what I meant, as you very well know!! – cfr Jul 05 '17 at 22:41
  • @cfr :-) Of course, and I didn't intend it to imply that. But I do stand by the statement that finding one of your answers would have been better. – Alan Munn Jul 05 '17 at 22:42
  • Perhaps, but so would many other answers, including yours. I've added 2 solutions as an answer to the linked question. (One for current Forest and one for version 1.) – cfr Jul 05 '17 at 22:54

2 Answers2

6

Note that I think I ought not answer do-it-for-mes, especially do-it- for-mes with a notable absence of ducks and for which there are copious existing and easily found solutions. However, I sometimes do so anyway. When I do, I answer them for me. If my code happens to be useful, so be it; if not, so be that. In particular, I am not at all sympathetic to requests for fine-tuning, adjustments, explanations or modifications. If a request tickles my fancy, I may address it. Otherwise, these are left as exercises for you, gentle reader.

This is based on the Minimal Working Example written by Biki Teron because the OP didn't provide one.

\documentclass[border=10pt]{standalone}
\usepackage[edges]{forest}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{forest}
  forked edges,
  for tree={edge+={-Latex}},
  [Number
    [Real Number
      [Rational Numbers
        [Fractional]
        [Integers]
      ]
      [Irrational Numbers]
    ]
    [Imaginary Number]
  ]
\end{forest}
\end{document}

Forest solution

cfr
  • 198,882
  • I run as it is, but it is giving errors. – Manpreet Dhiman Jul 06 '17 at 13:01
  • @ManpreetDhiman Oh. Works fine for me. Possibly the errors tell you what is wrong. Hard to say. Random guess: your TeX installation is old and Forest is old. See my answer to the question Alan Munn linked in that case. Or, preferably, update your TeX installation. Or you don't have Forest. Or you don't have TikZ. Or your compiler can't be found. Or one of indefinitely many other possibilities. Don't use LuaTeX if you compile the code as is. – cfr Jul 06 '17 at 15:05
  • Actually, compilation give error due to \usetikzlibrary{arrows.meta}, forest is fine, you are right problem is due to old version. And in case @Alan Munn, same version error (\usepackage[all]{genealogytree}) comes. And When I run same code on online LaTeX editor, it was working fine. From where I can download \usetikzlibrary{arrows.meta} and \usepackage[all]{genealogytree} package? Any link? – Manpreet Dhiman Jul 07 '17 at 05:30
  • @ManpreetDhiman Best is to update your TeX installation as a whole. – cfr Jul 07 '17 at 17:37
4

Using genealogytree package we can achive tree structure

  \documentclass[a4paper]{article}
  \usepackage[all]{genealogytree}


  \begin{document}

  \begin{genealogypicture}[processing=tikznode,
  level size=5mm,]
  child{ 
         g{Number} 
         child{ 
              g{Real Number}  
               child{ 
              g{Rational Numbers} c{Fractional} c{Integers} 
                    }
              c{Irrational Numbers}
              }
         child{ 
              g{Imaginary Number} 
              }

       }
  \end{genealogypicture}

  \end{document}

enter image description here

Biki Teron
  • 3,275