Graphics, Figures & Tablestree diagram

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Roseli_Ap_Leandro
Posts: 3
Joined: Mon May 15, 2017 5:25 pm

tree diagram

Post by Roseli_Ap_Leandro »

Why in the code below there are overlapping? Thanks

Code: Select all

\begin{tikzpicture}[ grow = right, sibling distance = 6em, level distance = 10em, edge from parent/.style = {draw, -latex}, every node/.style = {font=\footnotesize}, sloped ]]
\node {Moeda}
child { node {cara} 
	child { node { cara }} 
	child { node { coroa }}
	}
child { node {coroa } 
	child { node {cara}  } 
	child { node {coroa} } 
       };
\end{tikzpicture}
Last edited by Stefan Kottwitz on Mon May 15, 2017 6:44 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
TikZ book
User avatar
Stefan Kottwitz
Site Admin
Posts: 10315
Joined: Mon Mar 10, 2008 9:44 pm

tree diagram

Post by Stefan Kottwitz »

Hi Roseli,

welcome to the forum!

A normal TikZ tree doesn't look forward to deeper levels for adjusting space in upper levels. You could use the forest package, that does it.

But you can manually adjust the space between nodes in a level by adding options to the tikzpicture environment, such as:

Code: Select all

level 1/.style = {sibling distance = 10em},
level 2/.style = {sibling distance = 6em},
Stefan
LaTeX.org admin
Post Reply