After tweeking with tikz-qtree a lot, i ended up with the result below. But i dont know why the level distance after XML node is too long, and even when setting the level distance for said level, the line still stays long and thick.

enter image description here

% tree

\begin{tikzpicture}[grow'=right,level distance=1.2in,sibling distance=.05in]
\tikzset{edge from parent/.style={thick, draw, edge from parent fork right},
         every tree node/.style={draw,minimum width=1in,text width=1in,align=center},
         level 1/.style={sibling distance=-40mm},
         level 2/.style={level distance=10mm}}
 \Tree [.SGML {HTML 4.0} [.\node(x) {XML}; [ XHTML XML DOM [.XSL XSLT XSL-FO XPath ] XQuery DTD XSD SOAP WSDL RDF RSS SVG ] ] ]

edit: .\node(x) {XML}; or .XML dont make a diffrence

  • 1
    Welcome to TeX SE! Please edit your question and complete the code to make it a compilable document. Especially important when your document requires specialised packages and libraries. – cfr Feb 4 '15 at 17:17
  • What happens if you have .XML rather than .\node(x) {XML};? – cfr Feb 4 '15 at 17:23
  • A level distance of 10mm is too small, I think. The edge gets drawn through it. But I'm not really familiar with tikz-qtree. – cfr Feb 4 '15 at 17:30
  • It looks like you've got two separate accounts, which means you cannot edit your original post or leave comments. The StackExchange staff can merge them together for you. – Johannes_B Feb 4 '15 at 17:30
  • 1
    oh, sorry didnt pay attention to that, i filed the request and i'm trying to put up a compilable example – Tarik Feb 4 '15 at 17:33

If you don't mind changing packages, you could use the powerful forest:

    for tree={
      edge path={
        \noexpand\path [draw, thick, \forestoption{edge}] (!u.parent anchor) -- +(5pt,0) |- (.child anchor)\forestoption{edge label};
      parent anchor=east,
      child anchor=west,
      text centered,
      minimum width=1in,
      text width=1in
    [SGML [HTML 4.0] [XML [XHTML] [XML] [DOM] [XSL [XSLT] [XSL-FO] [XPath]] [XQuery] [DTD] [XSD] [SOAP] [WSDL] [RDF] [RSS] [SVG]]]

forest tree

  • i already found this package here but wasnt aware it supported horizontal and edge style, will gladly switch to it, thank you – Tarik Feb 4 '15 at 17:42
  • @Tarik I just corrected my code to centre the text, as in your original. It's a very powerful package - well worth the trouble to switch! – cfr Feb 4 '15 at 17:44
  • some of its options would have made my earlier trees easier to build (sidway dashed branches), will switch all the tree to it as well, documentation can be found here – Tarik Feb 4 '15 at 17:51
  • @Tarik There are also a lot of good examples on this site if you search. That's how I came to start using the package. – cfr Feb 4 '15 at 20:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.