|
Ich habe folgenden Baum erstellt: Open in Online-Editor
\begin{tikzpicture}[->,>=stealth',level/.style={sibling distance = 2cm, level distance = 1.5cm}] \node {@} child{ node {@} child{ node {$\lambda$} child{ node {x} } child{ node {$\mathrm{case_{List}}$} child {node {x}} child {node {2}} child {node {3}}} } child{ node [sibling distance = 20cm] {Cons} child{ node {$\lambda$} child {node {z}} child {node {z}}} child{ node {Nil}} } } child{ node {True} } ; \end{tikzpicture} Irgendwie funktioniert das nicht, dass der Abstand zwischen Cons und lambda größer wird. Deswegen überschneiden sich da die Kinder :/ |
|
Verwende die das geänderte Open in Online-Editor
\documentclass[tikz,margin=5pt]{standalone} \usetikzlibrary{arrows} \begin{document} \begin{tikzpicture}[->,>=stealth', level/.style={sibling distance = 2cm,level distance = 1.5cm} ] \node {@} child{ node {@} child{ node {$\lambda$} child{ node {x} } child{ node {$\mathrm{case_{List}}$} child {node {x}} child {node {2}} child {node {3}}} } child[sibling distance = 10cm]{node {Cons} child{ node {$\lambda$} child {node {z}} child {node {z}}} child{ node {Nil}} } } child{ node {True} } ; \end{tikzpicture} \end{document} Hier ist mal außerdem noch eine alternative Darstellungsmöglichkeit: Open in Online-Editor
\documentclass[tikz,margin=5pt]{standalone} \usetikzlibrary{arrows} \begin{document} \begin{tikzpicture}[ ->,>=stealth', level/.style={level distance=1.5cm,sibling distance=2cm}, level 2/.style={sibling distance=5cm}, level 4/.style={sibling distance=1cm} ] \node {@} child{ node {@} child{ node {$\lambda$} child{ node {x} } child{ node {$\mathrm{case_{List}}$} child {node {x}} child {node {2}} child {node {3}}} } child{ node {Cons} child{ node {$\lambda$} child {node {z}} child {node {z}}} child{ node {Nil}} } } child{ node {True} } ; \end{tikzpicture} \end{document} |
|
Zum Spaß mit TikZ Open in Online-Editor
\documentclass{article} \usepackage{tikz} \usetikzlibrary{graphs,graphdrawing} \usegdlibrary{trees} \begin{document} \begin{tikzpicture} \graph [fresh nodes,tree layout] { "@" -> { "@" -> { "$\lambda$" -> { "x", "$\mathrm{case_{List}}$" -> { "x", "2", "3" } }, "Cons" -> { "$\lambda$" -> { "z", "z" }, "Nil" } }, "True" } }; \end{tikzpicture} \end{document} |

Herzlich willkommen in der TeXwelt!Bitte gib immer ein vollständiges Minimalbeispiel an. Also ein möglichst kurzes, aber komplettes Dokument, von
\documentclass{...}bis zu\end{document}, was das Problem zeigt. Das vereinfacht die Bearbeitung erheblich.Es gibt übrigens
\textsubscriptfür tiefer gestellten Text im Textmodus. Wennx,2,Trueetc. nicht im Mathemodus gesetzt werden, würde ich das fürcase\textsubscript{List}verwenden.