
나무를 만들려고 하는데 가지의 길이가 고르지 않습니다. 또한 레이블을 더 짧거나 더 긴 문자열로 변경해야 할 수도 있습니다. 이 트리를 개선하기 위한 몇 가지 제안 사항이 있습니까?
\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}
생산물: