уменьшение пустого пространства под деревом 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 в команде draw. Я изменил его с -90 на -180 и добился желаемого интервала.

Связанный контент