使用控件而不影响图像大小

使用控件而不影响图像大小

我有以下树forest

\documentclass{article}                          


\usepackage{forest}

\usetikzlibrary{arrows}
\tikzset{
    %Define standard arrow tip
    >=stealth'}



\begin{document}
\begin{figure}
\begin{forest}
for tree={parent anchor=south, child anchor=north,align=center,base=bottom}
[AgrP
        [Spec-AgrP,name=specagr]
        [Agr$'$
                [Agr
                        [\textit{-ait},name=ait]]
                [NegP
                        [Spec-NegP
                                [\textit{pas},name=pas]]
                        [Neg$'$
                                [Neg
                                        [\textit{ne},name=ne]]
                                [TP
                                        [Spec-TP]
                                        [T$'$
                                                [T
                                                        [\textit{-er-},name=er]]
                                                [VP
                                                        [Spec-VP
                                                                [\textit{Marie},name=marie]]
                                                        [V$'$
                                                                [V
                                                                        [\textit{parl-},name=parl]]]]]]]]]]
\draw[->,dotted] (parl.south west) .. controls +(225:1cm) and +(south:0.4cm) .. (er.south);
\draw[->,dotted] (er.south west) .. controls +(left:1cm) and +(south:0.4cm) .. (ne.south);
\draw[->,dotted] (ne.south west) .. controls +(left:1cm) and +(south:0.4cm) .. (ait.south);
\draw[->,dotted] (marie.-90) .. controls +(225:6cm) and +(250:3cm) .. (specagr.-90);
\end{forest}
\caption{\label{abb-Pollock} Pollock's Analysis of \emph{Marie ne parlerait pas}}
\end{figure}


\end{document}

当我编译它时,标题离图片很远。原因是控制点的规格为 6cm。因此,tikz在确定图像大小时似乎要考虑控制点。我能做些什么呢?我缩短了 6cm,但这给出了其他曲线。

答案1

您可以将\draw命令放置在pgfinterruptboundingbox环境中。

在此处输入图片描述

\documentclass{article}                          


\usepackage{forest}

\usetikzlibrary{arrows}
\tikzset{
    %Define standard arrow tip
    >=stealth'}



\begin{document}
\begin{figure}
\centering
\begin{forest}
for tree={parent anchor=south, child anchor=north,align=center,base=bottom}
[AgrP
        [Spec-AgrP,name=specagr]
        [Agr$'$
                [Agr
                        [\textit{-ait},name=ait]]
                [NegP
                        [Spec-NegP
                                [\textit{pas},name=pas]]
                        [Neg$'$
                                [Neg
                                        [\textit{ne},name=ne]]
                                [TP
                                        [Spec-TP]
                                        [T$'$
                                                [T
                                                        [\textit{-er-},name=er]]
                                                [VP
                                                        [Spec-VP
                                                                [\textit{Marie},name=marie]]
                                                        [V$'$
                                                                [V
                                                                        [\textit{parl-},name=parl]]]]]]]]]]
\begin{pgfinterruptboundingbox}
\draw[->,dotted] (parl.south west) .. controls +(225:1cm) and +(south:0.4cm) .. (er.south);
\draw[->,dotted] (er.south west) .. controls +(left:1cm) and +(south:0.4cm) .. (ne.south);
\draw[->,dotted] (ne.south west) .. controls +(left:1cm) and +(south:0.4cm) .. (ait.south);
\draw[->,dotted] (marie.-90) .. controls +(225:6cm) and +(250:3cm) .. (specagr.-90);
\end{pgfinterruptboundingbox}
\end{forest}
\caption{\label{abb-Pollock} Pollock's Analysis of \emph{Marie ne parlerait pas}}
\end{figure}


\end{document}

相关内容