
我無法將如此巨大的樹木集合放在一頁上而不使頁碼變得模糊。誰能幫我?
\documentclass[12pt,a4paper]{article}
\usepackage{tikz-qtree}
\usepackage{tikz-qtree-compat}
\usepackage{ulem}
\begin{document}
\begin{tikzpicture}
\Tree [.S [.DP [.D some ] [.N woman ] ] [.VP [.V hugs ] [.DP [.D every ] [.N man ] ]]]
\end{tikzpicture}
\rotatebox{90}{\begin{tikzpicture}[baseline=(current bounding box.center), scale= 0.9]
\Tree [.S [.DP [.D some ] [.N woman ] ] [.VP [.V hugs ] [.DP [.D every ] [.N man ] ]]]
\end{tikzpicture} {\Huge$\Rightarrow$}
\begin{tikzpicture} [baseline=(current bounding box.center), scale=.45]
\Tree [.{\formula{\exists y [woman' (y) \land [\forall x [man' (x) \rightarrow hug'(y, x)]]: (t} \hspace{0.1cm}} [.{\formula{\lambda Q. \exists y [woman' (y) \land Q(x)]: (\forall X(e_{3} \rightarrow X) \rightarrow X))} \hspace{0.1cm}} [. { \formula{\lambda P. \lambda Q. \exists y [woman' (y) \land Q(x)] : (e_{4} \rightarrow t_{1})\rightarrow (\forall X(e_{3} \rightarrow X) \rightarrow X))}} ] [.{$\lambda z. woman(z)$: \formula{(e_{4} \rightarrow t_{1})}} ] ] [.{\formula{\lambda m. saw(k,m):(e_{3} \rightarrow t_{1})} } [. \node (ne) {e$_{2}$}; ] [.{\formula{\forall x [man' (x) \rightarrow saw'(j, x)] : t_{1} }} [.{\formula{\lambda Q. \forall x [man' (x) \rightarrow Q(x)]: (\forall X(e_{3} \rightarrow X) \rightarrow X))} \hspace{0.1cm}} [. { \formula{\lambda P. \lambda Q. \forall (x) [P(x) \rightarrow Q(x)]: (e_{4} \rightarrow t_{1})\rightarrow (\forall X(e_{3} \rightarrow X) \rightarrow X))}} ] [.{$\lambda$ x. x is a man: \formula{(e_{4} \rightarrow t_{1})}} ] ] [.{\formula{\lambda m. saw(k,m):(e_{3} \rightarrow t_{1})} } [. \node (ue) {e$_{3}$}; ] [.{\formula{saw(k,m): (t_{1}) \hspace{0.1cm} }} [.\node [circle,draw] (me) {k : e$_{2}$} ;] [.{\formula{\lambda x. saw(x,m): (e_{2} \rightarrow t_{1}) \hspace{0.1cm} }} [. {\formula{\lambda y\lambda x. saw(x,y): (e_{3} \rightarrow (e_{2} \rightarrow t_{1})} } ] [. \node [circle,draw] (le) {m : e$_{3}$} ; ] ] ] ] ] ] ] ] ]
\draw[semithick, dashed, ->] (le)..controls +(south west:5) and +(south:5) .. (ue);
\draw[semithick, dashed, ->] (me)..controls +(south west:7) and +(south:7) .. (ne);
\begin{scope}[xshift=-0.5cm,yshift=-10cm]
\Tree [.{\formula{\forall x [man' (x) \rightarrow[\exists y [woman' (y) \rightarrow hug'(y, x)]]: (t} \hspace{0.1cm}} [.{\formula{\lambda Q. \forall x [man' (x) \rightarrow Q(x)]: (\forall X(e_{3} \rightarrow X) \rightarrow X))} \hspace{0.1cm}} [. { \formula{\lambda P. \lambda Q. \forall x [P(x) \rightarrow Q(x)] : (e_{4} \rightarrow t_{1})\rightarrow (\forall X(e_{3} \rightarrow X) \rightarrow X))}} ] [.{$\lambda z. woman(z)$: \formula{(e_{4} \rightarrow t_{1})}} ] ] [.{\formula{\lambda m. saw(k,m):(e_{3} \rightarrow t_{1})} } [. \node (ne) {e$_{2}$}; ] [.{\formula{\exists x [woman' (y) \land saw'(j, y)] : t_{1} }} [.{\formula{\lambda Q. \exists (y) [woman'(y) \land Q(y)]: (\forall X(e_{3} \rightarrow X) \rightarrow X))} \hspace{0.1cm}} [. { \formula{\lambda P. \lambda Q. \exists (y) [P(y) \land Q(y)]: (e_{4} \rightarrow t_{1})\rightarrow (\forall X(e_{3} \rightarrow X) \rightarrow X))}} ] [.{$\lambda$ x. x is a man: \formula{(e_{4} \rightarrow t_{1})}} ] ] [.{\formula{\lambda m. saw(k,m):(e_{3} \rightarrow t_{1})} } [. \node (ue) {e$_{3}$}; ] [.{\formula{saw(k,m): (t_{1}) \hspace{0.1cm} }} [.\node [circle,draw] (le) {k : e$_{2}$} ;] [.{\formula{\lambda x. saw(x,m): (e_{2} \rightarrow t_{1}) \hspace{0.1cm} }} [. {\formula{\lambda y\lambda x. saw(x,y): (e_{3} \rightarrow (e_{2} \rightarrow t_{1})} } ] [. \node [circle,draw] (me) {m : e$_{3}$} ; ] ] ] ] ] ] ] ] ]
\draw[semithick, dashed, ->] (le)..controls +(south west:2) and +(south:2) .. (ue);
\draw[semithick, dashed, ->] (me)..controls +(south west:7) and +(south:7) .. (ne);
\end{scope}
\end{tikzpicture} }
\end{document}
答案1
好吧,你可以這樣做,但你的讀者不會為此感謝你!最好重新考慮如何呈現資訊(或在 A3 上列印)。
\documentclass[12pt,a4paper]{article}
\usepackage{tikz-qtree}
\usepackage{tikz-qtree-compat}
\newcommand\formula[1]{\ensuremath{#1}}
\usepackage{ulem}
\begin{document}
\begin{tikzpicture}
\Tree [.S [.DP [.D some ] [.N woman ] ] [.VP [.V hugs ] [.DP [.D every ] [.N man ] ]]]
\end{tikzpicture}
\rotatebox{90}{%
\resizebox{\textheight}{!}{%
\begin{tikzpicture}[baseline=(current bounding box.center)]
\Tree [.S [.DP [.D some ] [.N woman ] ] [.VP [.V hugs ] [.DP [.D every ] [.N man ] ]]]
\end{tikzpicture} {\Huge$\Rightarrow$}
\begin{tikzpicture} [baseline=(current bounding box.center), scale=.5]
\Tree [.{\formula{\exists y [woman' (y) \land [\forall x [man' (x) \rightarrow hug'(y, x)]]: (t} \hspace{0.1cm}} [.{\formula{\lambda Q. \exists y [woman' (y) \land Q(x)]: (\forall X(e_{3} \rightarrow X) \rightarrow X))} \hspace{0.1cm}} [. { \formula{\lambda P. \lambda Q. \exists y [woman' (y) \land Q(x)] : (e_{4} \rightarrow t_{1})\rightarrow (\forall X(e_{3} \rightarrow X) \rightarrow X))}} ] [.{$\lambda z. woman(z)$: \formula{(e_{4} \rightarrow t_{1})}} ] ] [.{\formula{\lambda m. saw(k,m):(e_{3} \rightarrow t_{1})} } [. \node (ne) {e$_{2}$}; ] [.{\formula{\forall x [man' (x) \rightarrow saw'(j, x)] : t_{1} }} [.{\formula{\lambda Q. \forall x [man' (x) \rightarrow Q(x)]: (\forall X(e_{3} \rightarrow X) \rightarrow X))} \hspace{0.1cm}} [. { \formula{\lambda P. \lambda Q. \forall (x) [P(x) \rightarrow Q(x)]: (e_{4} \rightarrow t_{1})\rightarrow (\forall X(e_{3} \rightarrow X) \rightarrow X))}} ] [.{$\lambda$ x. x is a man: \formula{(e_{4} \rightarrow t_{1})}} ] ] [.{\formula{\lambda m. saw(k,m):(e_{3} \rightarrow t_{1})} } [. \node (ue) {e$_{3}$}; ] [.{\formula{saw(k,m): (t_{1}) \hspace{0.1cm} }} [.\node [circle,draw] (me) {k : e$_{2}$} ;] [.{\formula{\lambda x. saw(x,m): (e_{2} \rightarrow t_{1}) \hspace{0.1cm} }} [. {\formula{\lambda y\lambda x. saw(x,y): (e_{3} \rightarrow (e_{2} \rightarrow t_{1})} } ] [. \node [circle,draw] (le) {m : e$_{3}$} ; ] ] ] ] ] ] ] ] ]
\draw[semithick, dashed, ->] (le)..controls +(south west:5) and +(south:5) .. (ue);
\draw[semithick, dashed, ->] (me)..controls +(south west:7) and +(south:7) .. (ne);
\begin{scope}[xshift=-0.5cm,yshift=-10cm]
\Tree [.{\formula{\forall x [man' (x) \rightarrow[\exists y [woman' (y) \rightarrow hug'(y, x)]]: (t} \hspace{0.1cm}} [.{\formula{\lambda Q. \forall x [man' (x) \rightarrow Q(x)]: (\forall X(e_{3} \rightarrow X) \rightarrow X))} \hspace{0.1cm}} [. { \formula{\lambda P. \lambda Q. \forall x [P(x) \rightarrow Q(x)] : (e_{4} \rightarrow t_{1})\rightarrow (\forall X(e_{3} \rightarrow X) \rightarrow X))}} ] [.{$\lambda z. woman(z)$: \formula{(e_{4} \rightarrow t_{1})}} ] ] [.{\formula{\lambda m. saw(k,m):(e_{3} \rightarrow t_{1})} } [. \node (ne) {e$_{2}$}; ] [.{\formula{\exists x [woman' (y) \land saw'(j, y)] : t_{1} }} [.{\formula{\lambda Q. \exists (y) [woman'(y) \land Q(y)]: (\forall X(e_{3} \rightarrow X) \rightarrow X))} \hspace{0.1cm}} [. { \formula{\lambda P. \lambda Q. \exists (y) [P(y) \land Q(y)]: (e_{4} \rightarrow t_{1})\rightarrow (\forall X(e_{3} \rightarrow X) \rightarrow X))}} ] [.{$\lambda$ x. x is a man: \formula{(e_{4} \rightarrow t_{1})}} ] ] [.{\formula{\lambda m. saw(k,m):(e_{3} \rightarrow t_{1})} } [. \node (ue) {e$_{3}$}; ] [.{\formula{saw(k,m): (t_{1}) \hspace{0.1cm} }} [.\node [circle,draw] (le) {k : e$_{2}$} ;] [.{\formula{\lambda x. saw(x,m): (e_{2} \rightarrow t_{1}) \hspace{0.1cm} }} [. {\formula{\lambda y\lambda x. saw(x,y): (e_{3} \rightarrow (e_{2} \rightarrow t_{1})} } ] [. \node [circle,draw] (me) {m : e$_{3}$} ; ] ] ] ] ] ] ] ] ]
\draw[semithick, dashed, ->] (le)..controls +(south west:2) and +(south:2) .. (ue);
\draw[semithick, dashed, ->] (me)..controls +(south west:7) and +(south:7) .. (ne);
\end{scope}
\end{tikzpicture}}}
\end{document}
如果您希望第一棵樹位於同一頁上,您可以嘗試這樣做,但是您的讀者會發現這並不容易:
\documentclass[12pt,a4paper]{article}
\usepackage{tikz-qtree}
\usepackage{tikz-qtree-compat}
\newcommand\formula[1]{\ensuremath{#1}}
\usepackage{ulem}
\begin{document}
\rotatebox{90}{%
\begin{minipage}{\textheight}
\begin{tikzpicture}
\Tree [.S [.DP [.D some ] [.N woman ] ] [.VP [.V hugs ] [.DP [.D every ] [.N man ] ]]]
\end{tikzpicture}
\resizebox{\textheight}{!}{%
\begin{tikzpicture}[baseline=(current bounding box.center)]
\Tree [.S [.DP [.D some ] [.N woman ] ] [.VP [.V hugs ] [.DP [.D every ] [.N man ] ]]]
\end{tikzpicture} {\Huge$\Rightarrow$}
\begin{tikzpicture} [baseline=(current bounding box.center), scale=.5]
\Tree [.{\formula{\exists y [woman' (y) \land [\forall x [man' (x) \rightarrow hug'(y, x)]]: (t} \hspace{0.1cm}} [.{\formula{\lambda Q. \exists y [woman' (y) \land Q(x)]: (\forall X(e_{3} \rightarrow X) \rightarrow X))} \hspace{0.1cm}} [. { \formula{\lambda P. \lambda Q. \exists y [woman' (y) \land Q(x)] : (e_{4} \rightarrow t_{1})\rightarrow (\forall X(e_{3} \rightarrow X) \rightarrow X))}} ] [.{$\lambda z. woman(z)$: \formula{(e_{4} \rightarrow t_{1})}} ] ] [.{\formula{\lambda m. saw(k,m):(e_{3} \rightarrow t_{1})} } [. \node (ne) {e$_{2}$}; ] [.{\formula{\forall x [man' (x) \rightarrow saw'(j, x)] : t_{1} }} [.{\formula{\lambda Q. \forall x [man' (x) \rightarrow Q(x)]: (\forall X(e_{3} \rightarrow X) \rightarrow X))} \hspace{0.1cm}} [. { \formula{\lambda P. \lambda Q. \forall (x) [P(x) \rightarrow Q(x)]: (e_{4} \rightarrow t_{1})\rightarrow (\forall X(e_{3} \rightarrow X) \rightarrow X))}} ] [.{$\lambda$ x. x is a man: \formula{(e_{4} \rightarrow t_{1})}} ] ] [.{\formula{\lambda m. saw(k,m):(e_{3} \rightarrow t_{1})} } [. \node (ue) {e$_{3}$}; ] [.{\formula{saw(k,m): (t_{1}) \hspace{0.1cm} }} [.\node [circle,draw] (me) {k : e$_{2}$} ;] [.{\formula{\lambda x. saw(x,m): (e_{2} \rightarrow t_{1}) \hspace{0.1cm} }} [. {\formula{\lambda y\lambda x. saw(x,y): (e_{3} \rightarrow (e_{2} \rightarrow t_{1})} } ] [. \node [circle,draw] (le) {m : e$_{3}$} ; ] ] ] ] ] ] ] ] ]
\draw[semithick, dashed, ->] (le)..controls +(south west:5) and +(south:5) .. (ue);
\draw[semithick, dashed, ->] (me)..controls +(south west:7) and +(south:7) .. (ne);
\begin{scope}[xshift=-0.5cm,yshift=-10cm]
\Tree [.{\formula{\forall x [man' (x) \rightarrow[\exists y [woman' (y) \rightarrow hug'(y, x)]]: (t} \hspace{0.1cm}} [.{\formula{\lambda Q. \forall x [man' (x) \rightarrow Q(x)]: (\forall X(e_{3} \rightarrow X) \rightarrow X))} \hspace{0.1cm}} [. { \formula{\lambda P. \lambda Q. \forall x [P(x) \rightarrow Q(x)] : (e_{4} \rightarrow t_{1})\rightarrow (\forall X(e_{3} \rightarrow X) \rightarrow X))}} ] [.{$\lambda z. woman(z)$: \formula{(e_{4} \rightarrow t_{1})}} ] ] [.{\formula{\lambda m. saw(k,m):(e_{3} \rightarrow t_{1})} } [. \node (ne) {e$_{2}$}; ] [.{\formula{\exists x [woman' (y) \land saw'(j, y)] : t_{1} }} [.{\formula{\lambda Q. \exists (y) [woman'(y) \land Q(y)]: (\forall X(e_{3} \rightarrow X) \rightarrow X))} \hspace{0.1cm}} [. { \formula{\lambda P. \lambda Q. \exists (y) [P(y) \land Q(y)]: (e_{4} \rightarrow t_{1})\rightarrow (\forall X(e_{3} \rightarrow X) \rightarrow X))}} ] [.{$\lambda$ x. x is a man: \formula{(e_{4} \rightarrow t_{1})}} ] ] [.{\formula{\lambda m. saw(k,m):(e_{3} \rightarrow t_{1})} } [. \node (ue) {e$_{3}$}; ] [.{\formula{saw(k,m): (t_{1}) \hspace{0.1cm} }} [.\node [circle,draw] (le) {k : e$_{2}$} ;] [.{\formula{\lambda x. saw(x,m): (e_{2} \rightarrow t_{1}) \hspace{0.1cm} }} [. {\formula{\lambda y\lambda x. saw(x,y): (e_{3} \rightarrow (e_{2} \rightarrow t_{1})} } ] [. \node [circle,draw] (me) {m : e$_{3}$} ; ] ] ] ] ] ] ] ] ]
\draw[semithick, dashed, ->] (le)..controls +(south west:2) and +(south:2) .. (ue);
\draw[semithick, dashed, ->] (me)..controls +(south west:7) and +(south:7) .. (ne);
\end{scope}
\end{tikzpicture}}
\end{minipage}}
\end{document}
如果您希望樹木居中,請添加\centering
:\minipage
我認為不同的縮放具有一定的意義,因此我在旋轉框中保持相對縮放不變。然而,結果顯然看起來有點奇怪...
答案2
我同意 CFR 的觀點,您可能需要重新考慮在一頁上放置了多少信息,特別是您是否真的需要頂部的樹,然後在箭頭之前複製該樹。
以下是我所做的節省空間的變更。它們都是相互獨立的,因此您可以進行調整以滿足您的需求,但我認為您會發現換行的效果最大。
- 樹節點內的換行。在你的語意樹中,我在冒號處換行。為了允許節點內換行,您將需要
every tree node/.style={align=center,anchor=north}
.我還調整了,level distance
以防止一旦線條斷裂,樹枝變得太平或倒轉。 - 邊距。我使用包裝將所有邊距減少到 2.5 公分
geometry
。 - 縮放。我使用了
\scalebox
提供的命令graphicx
,該命令由 加載tikz
。我發現它比scale
中的選項效果更好tikz
。
\documentclass[12pt,a4paper]{article}
\usepackage{tikz-qtree}
\usepackage{tikz-qtree-compat}
\newcommand\formula[1]{\ensuremath{#1}}
\usepackage{ulem}
\usepackage[margin=2.5cm]{geometry}
\begin{document}
\scalebox{.7}{
\begin{tikzpicture}
\Tree [.S [.DP [.D some ] [.N woman ] ] [.VP [.V hugs ] [.DP [.D every ] [.N man ] ]]]
\end{tikzpicture}
}
\rotatebox{90}{%
\scalebox{.6}{
\begin{tikzpicture}[baseline=(current bounding box.center)]
\Tree [.S [.DP [.D some ] [.N woman ] ] [.VP [.V hugs ] [.DP [.D every ] [.N man ] ]]]
\end{tikzpicture} {\Huge$\Rightarrow$}
}
\scalebox{.6}{
\begin{tikzpicture} [baseline=(current bounding box.center), every tree node/.style={align=center,anchor=north}, level distance = 9ex]
\Tree [.{\formula{\exists y [woman' (y) \land [\forall x [man' (x) \rightarrow hug'(y, x)]]:}\\\formula{(t} \hspace{0.1cm}} [.{\formula{\lambda Q. \exists y [woman' (y) \land Q(x)]:}\\ \formula{(\forall X(e_{3} \rightarrow X) \rightarrow X))} \hspace{0.1cm}} [. { \formula{\lambda P. \lambda Q. \exists y [woman' (y) \land Q(x)] :}\\ \formula{(e_{4} \rightarrow t_{1})\rightarrow (\forall X(e_{3} \rightarrow X) \rightarrow X))}} ] [.{$\lambda z. woman(z)$:\\ \formula{(e_{4} \rightarrow t_{1})}} ] ] [.{\formula{\lambda m. saw(k,m):}\\\formula{(e_{3} \rightarrow t_{1})} } [. \node (ne) {e$_{2}$}; ] [.{\formula{\forall x [man' (x) \rightarrow saw'(j, x)] :}\\\formula{t_{1} }} [.{\formula{\lambda Q. \forall x [man' (x) \rightarrow Q(x)]:}\\ \formula{(\forall X(e_{3} \rightarrow X) \rightarrow X))} \hspace{0.1cm}} [. { \formula{\lambda P. \lambda Q. \forall (x) [P(x) \rightarrow Q(x)]:}\\\formula{(e_{4} \rightarrow t_{1})\rightarrow (\forall X(e_{3} \rightarrow X) \rightarrow X))}} ] [.{$\lambda$ x. x is a man:\\ \formula{(e_{4} \rightarrow t_{1})}} ] ] [.{\formula{\lambda m. saw(k,m):}\\\formula{(e_{3} \rightarrow t_{1})} } [. \node (ue) {e$_{3}$}; ] [.{\formula{saw(k,m):}\\\formula{(t_{1}) \hspace{0.1cm} }} [.\node [circle,draw] (me) {k : e$_{2}$} ;] [.{\formula{\lambda x. saw(x,m):}\\\formula{ (e_{2} \rightarrow t_{1}) \hspace{0.1cm} }} [. {\formula{\lambda y\lambda x. saw(x,y):}\\\formula{ (e_{3} \rightarrow (e_{2} \rightarrow t_{1})} } ] [. \node [circle,draw] (le) {m : e$_{3}$} ; ] ] ] ] ] ] ] ] ]
\draw[semithick, dashed, ->] (le.south west)..controls +(south west:4) and +(south:5) .. (ue);
\draw[semithick, dashed, ->] (me.south west)..controls +(-10,-3) and +(south:7) .. (ne);
\begin{scope}[xshift=-0.5cm,yshift=-12cm]
\Tree [.{\formula{\forall x [man' (x) \rightarrow[\exists y [woman' (y) \rightarrow hug'(y, x)]]:}\\\formula{ (t} \hspace{0.1cm}} [.{\formula{\lambda Q. \forall x [man' (x) \rightarrow Q(x)]:}\\\formula{ (\forall X(e_{3} \rightarrow X) \rightarrow X))} \hspace{0.1cm}} [. { \formula{\lambda P. \lambda Q. \forall x [P(x) \rightarrow Q(x)] :}\\\formula{ (e_{4} \rightarrow t_{1})\rightarrow (\forall X(e_{3} \rightarrow X) \rightarrow X))}} ] [.{$\lambda z. woman(z)$:\\\formula{(e_{4} \rightarrow t_{1})}} ] ] [.{\formula{\lambda m. saw(k,m):}\\\formula{(e_{3} \rightarrow t_{1})} } [. \node (ne) {e$_{2}$}; ] [.{\formula{\exists x [woman' (y) \land saw'(j, y)] :}\\\formula{ t_{1} }} [.{\formula{\lambda Q. \exists (y) [woman'(y) \land Q(y)]:}\\\formula{ (\forall X(e_{3} \rightarrow X) \rightarrow X))} \hspace{0.1cm}} [. { \formula{\lambda P. \lambda Q. \exists (y) [P(y) \land Q(y)]:}\\\formula{ (e_{4} \rightarrow t_{1})\rightarrow (\forall X(e_{3} \rightarrow X) \rightarrow X))}} ] [.{$\lambda$ x. x is a man:\\\formula{(e_{4} \rightarrow t_{1})}} ] ] [.{\formula{\lambda m. saw(k,m):}\\\formula{(e_{3} \rightarrow t_{1})} } [. \node (ue) {e$_{3}$}; ] [.{\formula{saw(k,m):}\\\formula{ (t_{1}) \hspace{0.1cm} }} [.\node [circle,draw] (le) {k : e$_{2}$} ;] [.{\formula{\lambda x. saw(x,m):}\\\formula{ (e_{2} \rightarrow t_{1}) \hspace{0.1cm} }} [. {\formula{\lambda y\lambda x. saw(x,y):}\\\formula{ (e_{3} \rightarrow (e_{2} \rightarrow t_{1})} } ] [. \node [circle,draw] (me) {m : e$_{3}$} ; ] ] ] ] ] ] ] ] ]
\draw[semithick, dashed, ->] (le.west)..controls +(west:1) and +(south:1) .. (ue);
\draw[semithick, dashed, ->] (me.south west)..controls +(-12,-3) and +(south:8) .. (ne);
\end{scope}
\end{tikzpicture}}}
\end{document}