
Ich versuche, einen Baum zu erstellen, aber die Länge der Äste ist ungleichmäßig. Außerdem muss ich möglicherweise die Beschriftungen in kürzere/längere Zeichenfolgen ändern. Haben Sie Vorschläge zur Verbesserung dieses Baums?
\documentclass[tikz]{standalone}
\usepackage{tikz-qtree}
\begin{document}
\begin{tikzpicture}[level distance=50pt]
\Tree [ \edge node[auto=right]{abcdef};
[.$C$ ] \edge node[auto=left]{$\neg$abcdef};
[ \edge node[auto=right]{abcdef};
[.$C$ ] \edge node[auto=left]{$\neg$abcdef};
[\edge node[auto=right]{abcde};
[\edge node[auto=right]{abcdef};
[\edge node[auto=right]{abcdef};
[\edge node[auto=right]{abcdef};
[.$C$ ]\edge node[auto=left]{$\neg$abcdef};
[.$C$ ] ]\edge node[auto=left]{$\neg$abcdef};
[.$C$ ] ]\edge node[auto=left]{$\neg$abcdef};
[.$C$ ] ]\edge node[auto=left]{$\neg $abcde};
[.$C$ ] ] ] ]
\end{tikzpicture}
\end{document}
Antwort1
Hier ist ein Beispiel mit dem qtree-Paket. Nur der Hauptbaum würde nicht all die Manipulationen in der Präambel erfordern. Es ging nur darum, die Nummerierung der Zeilen und die rechts eingegebenen Begründungen zu erhalten. Die Lösung dafür ist alles andere als perfekt, aber wenn Sie nur den Baum selbst benötigen, brauchen Sie diese Hacks überhaupt nicht. Dies ist ein Beispiel aus einer Übung, bei der die Gültigkeit von Argumenten mithilfe von Bäumen nachgewiesen werden muss.
\documentclass{article}
\usepackage{qtree}
\usepackage{amssymb}
\newcommand*{\tnot}{\ensuremath{\mathord{\sim}}}
\makeatletter
\newcommand{\nounibranches}[1]{% One-branching only
\begin{picture}(0,1)
\put(0,0){\line(0,1){0}}
\end{picture}}%
\newcommand{\nobibranches}[1]{% Two-branching only
\begin{picture}(2,0.5)
\put(0,0){\line(2,1){0}}
\put(2,0){\line(-2,1){0}}
\end{picture}}%
\let\qdrawReal=\qdraw@branches
\def\dimbr#1{\ifcase#1\relax % zero case is unused
\or % One-branching
\let\qdraw@branches=\nounibranches
\or % Two-branching
\let\qdraw@branches=\nobibranches
\else \typeout{error --- Can't handle #1-way branching}
\fi}
\newcommand\breto{\let\qdraw@branches=\qdrawReal}
\makeatother
\begin{document}
\hspace*{-\parindent}
{$(\exists x)(\forall y)(Py \equiv x = y) \vdash (\exists x)((\forall y)(Py \supset x = y) \,\&\, Px)$}\bigskip\\
\Tree
[.{1\\2}
[.3
[.4
[.{5\\[-.5em]\mbox{ }}
[.{6\\7\\[-.25em]\mbox{ }}
[.8
[.9
[.{10\\11}
[.12
[.{13\\14}
[.15
!{\dimbr1}
]
]
]
]
]
]
]
]
]
]
] {\breto}
\Tree
[.{$(\exists x)(\forall y)(Py \equiv x = y)\ \checkmark a$\\$\tnot (\exists x)((\forall y)(Py \supset x = y) \,\&\, Px)\ \backslash a$}
[.{$(\forall y)(Py \equiv a = y)\ \backslash a,b$}
[.{$\tnot ((\forall y)(Py \supset a = y) \,\&\, Pa)\ \checkmark$}
[.{$Pa \equiv a = a\ \checkmark$}
[.{$Pa$\\$a = a$}
[.{$\tnot (\forall y)(Py \supset a = y)\ \checkmark b$}
[.{$\tnot (Pb \supset a = b)\ \checkmark$}
[.{$Pb$\\$a \neq b$}
[.{$Pb \equiv a = b\ \checkmark$}
[.{$Pb$\\$a = b$}
[.{$a \neq a$\\$\otimes$\\15}
]
]
[.{$\tnot Pb$\\$a \neq b$\\$\otimes$\\10,13}
]
]
]
]
]
[.{$\tnot Pa$\\$\otimes$\\6,8}
]
]
[.{$\tnot Pa$\\$a \neq a$\\$\otimes$\\7}
]
]
]
]
]
\Tree
[.{Premise\\Conclusion negated}
[.{From 1}
[.{From 2}
[.{From 3\\[-.5em]\mbox{ }}
[.{From 5\\From 5\\[-.25em]\mbox{ }}
[.{From 4}
[.{From 8}
[.{From 9\\From 9}
[.{From 3}
[.{From 12\\From 12}
[.{From 11,14}
!{\dimbr1}
]
]
]
]
]
]
]
]
]
]
] {\breto}
\end{document}
Produziert: