減少 tikz-qtree 樹​​下方的空白

減少 tikz-qtree 樹​​下方的空白

我在我的論文中包含了句法樹。每棵樹下面都有大量的空白,這會讓大學的編輯部尖叫、嚎叫和呻吟,最終拒絕我的論文,直到我修改它。如何刪除樹下方多餘的空白?

微量元素:

\documentclass{article}
\usepackage{tikz-qtree,tikz-qtree-compat}
\usepackage{gb4e}
\tikzset{every tree node/.style={align=center, anchor=north}}
\begin{document}
The relevant structure in \ref{tree:opt-marker-verb-move} shows the necessary movement for the verb to precede the suffix. XP refers to some unknown structure to which the verb is drawn.

\begin{exe}
\ex
\leavevmode\vadjust{\vspace{-\baselineskip}}\newline %this command makes the example number line up with the top of the tree, rather than the bottom
\begin{tikzpicture}
\tikzset{every tree node/.style={align=center,anchor=north}}
\Tree [.XP \node(XP){}; 
[.\textsc{FocusP} =em 
[.TP
[.vP {} 
[.VP {} 
[.V \node(VERB){puv}; ] 
] ] ] ] ]
\draw[->] (VERB) [in=-90,out=-90,looseness=1.5] to (XP);
\end{tikzpicture}\label{tree:opt-marker-verb-move}
\end{exe}

It is difficult to justify this verbal movement. First, we would have to identify a higher structure in a suitable relationship with the verb to motivate verbal movement. Then we would have to identify features to check that exist on both the new structure and the verb.
\end{document}

答案1

一種選擇是使用pgfinterruptboundingbox中斷曲線路徑的邊界框;然後必須添加一些手動間距(或者,請參閱下文以避免手動幹預):

\documentclass{article}
\usepackage{tikz-qtree,tikz-qtree-compat}
\usepackage{gb4e}
\tikzset{every tree node/.style={align=center, anchor=north}}
\begin{document}
The relevant structure in \ref{tree:opt-marker-verb-move} shows the necessary movement for the verb to precede the suffix. XP refers to some unknown structure to which the verb is drawn.


\begin{exe}
\ex
\leavevmode\vadjust{\vspace{-\baselineskip}}\newline %this command makes the example number line up with the top of the tree, rather than the bottom
\begin{tikzpicture}
\tikzset{every tree node/.style={align=center,anchor=north}}
\Tree [.XP \node(XP){}; 
[.\textsc{FocusP} =em 
[.TP
[.vP {} 
[.VP {} 
[.V \node(VERB){puv}; ] 
] ] ] ] ]
\begin{pgfinterruptboundingbox}
\draw[->] (VERB) [in=-90,out=-90,looseness=1.5] to (XP);
\end{pgfinterruptboundingbox}
\end{tikzpicture}\vspace{30pt}
\label{tree:opt-marker-verb-move}
\end{exe}

It is difficult to justify this verbal movement. First, we would have to identify a higher structure in a suitable relationship with the verb to motivate verbal movement. Then we would have to identify features to check that exist on both the new structure and the verb.

\end{document}

在此輸入影像描述

為了避免手動添加間距,只需在邊界框被打斷後將任何合理的內容(例如空節點)放置在最低節點下方即可:

\documentclass{article}
\usepackage{tikz-qtree,tikz-qtree-compat}
\usetikzlibrary{positioning}
\usepackage{gb4e}
\tikzset{every tree node/.style={align=center, anchor=north}}
\begin{document}
The relevant structure in \ref{tree:opt-marker-verb-move} shows the necessary movement for the verb to precede the suffix. XP refers to some unknown structure to which the verb is drawn.


\begin{exe}
\ex
\leavevmode\vadjust{\vspace{-\baselineskip}}\newline %this command makes the example number line up with the top of the tree, rather than the bottom
\begin{tikzpicture}
\tikzset{every tree node/.style={align=center,anchor=north}}
\Tree [.XP \node(XP){}; 
[.\textsc{FocusP} =em 
[.TP
[.vP {} 
[.VP {} 
[.V \node(VERB){puv}; ] 
] ] ] ] ]
\begin{pgfinterruptboundingbox}
\draw[->] (VERB) [in=-90,out=-90,looseness=1.5] to (XP);
\end{pgfinterruptboundingbox}
\node[below=of VERB] {};
\end{tikzpicture}
\label{tree:opt-marker-verb-move}
\end{exe}

It is difficult to justify this verbal movement. First, we would have to identify a higher structure in a suitable relationship with the verb to motivate verbal movement. Then we would have to identify features to check that exist on both the new structure and the verb.

\end{document}

答案2

\useasboundingbox您可以在命令之前使用\draw,以避免它影響邊界框。必須為箭頭添加下面的一些額外空間,因此[yshift=-1.2cm](透過反覆試驗發現)。

\documentclass{article}
\usepackage{tikz-qtree,tikz-qtree-compat}
\usepackage{gb4e}
\tikzset{every tree node/.style={align=center, anchor=north}}
\begin{document}
The relevant structure in \ref{tree:opt-marker-verb-move} shows the necessary movement for the verb to precede the suffix. XP refers to some unknown structure to which the verb is drawn.

\begin{exe}
\ex
\leavevmode\vadjust{\vspace{-\baselineskip}}\newline %this command makes the example number line up with the top of the tree, rather than the bottom
\begin{tikzpicture}
\tikzset{every tree node/.style={align=center,anchor=north}}
\Tree [.XP \node(XP){}; 
[.\textsc{FocusP} =em 
[.TP
[.vP {} 
[.VP {} 
[.V \node(VERB){puv}; ] 
] ] ] ] ]
\useasboundingbox (current bounding box.north west) rectangle ([yshift=-1.2cm]current bounding box.south east);

\draw[->] (VERB) [in=-90,out=-90,looseness=1.5] to (XP);
\end{tikzpicture}\label{tree:opt-marker-verb-move}
\end{exe}

It is difficult to justify this verbal movement. First, we would have to identify a higher structure in a suitable relationship with the verb to motivate verbal movement. Then we would have to identify features to check that exist on both the new structure and the verb.
\end{document}

在此輸入影像描述

答案3

我能夠透過擺弄繪圖指令中的 out 值來消除大部分空白。我將其從-90 更改為-180,並達到了所需的間距。

相關內容