我无法将如此庞大的树木集合放在一页上,否则页码会被遮住。有人能帮我吗?
\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}