
ツリーを構築しようとしていますが、枝の長さが不均一です。さらに、ラベルを短い/長い文字列に変更する必要があるかもしれません。このツリーを改善するための提案はありますか?
\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}
答え1
qtree パッケージを使用した例を示します。メイン ツリーだけであれば、プリアンブルであれこれいじる必要はありません。これは、行番号と右側に入力された正当化を取得するためだけのものです。その解決策は完璧とは程遠いものですが、ツリー自体だけが必要な場合は、これらのハックはまったく必要ありません。これは、ツリーを使用して議論の妥当性を示す必要がある演習からの例です。
\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}
生産: