3

I have got a problem with trees like the one on the right: enter image description here

The Minimal Working Example that generate this is:

\documentclass{article}
\usepackage[linguistics]{forest}
\begin{document}
%
\begin{figure}
\begin{minipage}{0.5\linewidth}
\centering
    \begin{forest}
    [TopP, s sep=3em
        [DP,name=top]
        [TP
            [DP]
            [VP,s sep=3em
                [V]
                [\emph{t},name=obj]
            ]%
        ]%
    ]%
    \end{forest}
\caption{A big tree}
\end{minipage}
\begin{minipage}{0.5\linewidth}
\centering
    \begin{forest}
    [TopP, s sep=3em
        [DP,name=top]
        [TP
            [DP]
            [VP,s sep=3em
                [V]
                [\emph{t},name=obj]
            ]%
        ]%
    ]%
    \draw [->,dashed] (obj) to[out=south west,in= south] (top);%
    \end{forest}
\caption{Another big tree}
\end{minipage}
\end{figure}
%
\end{document}

Adding the arrow on the very same tree results in having the caption pushed down, in certain cases by a lot. I think I understand that it has something to do with the control points for the definition of the arrow, and I would like to know whether there is some way to prevent this, perhaps some way to crop the tikz image so that all the space taken by the control points does not count in the image.

Thank you very much for the help!

4

You can use \useasboundingbox (or \clip, for that matter) like this:

output of code

\documentclass{article}
\usepackage[linguistics]{forest}
\begin{document}
%
\begin{figure}
\begin{minipage}{0.5\linewidth}
\centering
    \begin{forest}
    [TopP, s sep=3em
        [DP,name=top]
        [TP
            [DP]
            [VP,s sep=3em
                [V]
                [\emph{t},name=obj]
            ]%
        ]%
    ]%
    \end{forest}
\caption{A big tree}
\end{minipage}% <--- you need this to avoid an overfull box
\begin{minipage}{0.5\linewidth}
\centering
    \begin{forest}
    [TopP, s sep=3em
        [DP,name=top]
        [TP
            [DP]
            [VP,s sep=3em
                [V]
                [\emph{t},name=obj]
            ]%
        ]%
    ]%
    \useasboundingbox (current bounding box.north west) rectangle ([yshift=-3mm]current bounding box.south east);
    \draw [->,dashed] (obj) to[out=south west,in= south] (top);%
    \end{forest}
\caption{Another big tree}
\end{minipage}
\end{figure}
%
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.