두 개의 숲 그림이 있고 tikzmark 사용

두 개의 숲 그림이 있고 tikzmark 사용

forest동일한 환경에 두 개의 그림이 있는데 두 그림 모두에서 figure사용하고 싶습니다 . tikzmark결과는 다음과 같습니다.

여기에 이미지 설명을 입력하세요

내 현재 코드는 다음과 같습니다.

\documentclass{article}                          


\usepackage{forest}

\usetikzlibrary{tikzmark}

\forestset{
sn edges/.style={for tree={parent anchor=south, child
anchor=north,align=center,base=bottom,
where n children=0{tier=word}{}}}
}


\newcommand{\spirit}[1]{%
{\renewcommand{\arraystretch}{0}%
\begin{tabular}[t]{@{}c@{}}%
\ibox{#1}\\[-3.2mm]
\large/\\%
\end{tabular}}}

\newcommand{\sliste}[1]{%
\mbox{%
$\left\langle\mbox{\upshape\scshape #1}\right\rangle$}%
}

\def\ibox#1{\mbox{}\setbox2=\hbox{$\scriptstyle #1$}\lower.2ex\vbox{\hrule
        \hbox{\vrule\kern1.25pt 
        \vbox{\kern1.25pt\box2\kern1.25pt}\kern1.25pt\vrule}\hrule}}

\begin{document}


\begin{figure}
\hfill\resizebox{0.47\linewidth}{!}{%
\begin{forest}
sn edges, for tree={l sep= 6ex}
[V{[{\sc subcat} \sliste{ \spirit{1}, \spirit{2} }]}
        [\ibox{1} NP{[\textit{nom}]}
                [er]]
        [V{[{\sc subcat} \sliste{ \ibox{1}, \spirit{2} } ]}
                [\ibox{2} NP{[\textit{acc}]}
                        [die Äpfel,triangle]]
                [V{[{\sc subcat} \sliste{ \ibox{1}, \ibox{2} } ]}
                        [\tikzmark{ap1}{AP}
                                [ungewaschen]]
                        [V{[{\sc subcat} \sliste{ \tikzmark{arg11}{\ibox{1}}, \tikzmark{arg12}{\ibox{2}} }]}
                                [isst]]]]]
\end{forest}
}
\hfill\resizebox{0.47\linewidth}{!}{%
\begin{forest}
sn edges, for tree={l sep= 6ex}
[V{[{\sc subcat} \sliste{ \spirit{1}, \spirit{2} } ]}
        [\ibox{1} NP{[\textit{nom}]}
                [er]]
        [V{[{\sc subcat} \sliste{ \ibox{1}, \spirit{2} } ]}
                [\tikzmark{ap2}{AP}
                        [ungewaschen]]
                [V{[{\sc subcat} \sliste{ \tikzmark{arg21}{\ibox{1}}, \spirit{2} } ]}
                        [\ibox{2} NP{[\textit{acc}]}
                                [die Äpfel,triangle]]
                        [V{[{\sc subcat} \sliste{ \ibox{1}, \ibox{2} } ]}
                                [isst]]]]]
\end{forest}
\begin{tikzpicture}[overlay,remember picture]
\draw[->, bend angle=40, bend left] ($(pic cs:ap1)+(1ex,2ex)$) to($(pic cs:arg11)+(1ex,2.5ex)$);
\draw[->, bend angle=40, bend left] ($(pic cs:ap1)+(1ex,2ex)$) to($(pic cs:arg12)+(1ex,2.5ex)$); % 1ex links, 2ex hoch
%
\draw[->, bend angle=40, bend left] ($(pic cs:ap2)+(1ex,2ex)$) to($(pic cs:arg21)+(1ex,2.5ex)$);
\end{tikzpicture}
}
\hfill\mbox{}
\caption{Analysis of \emph{dass er die Äpfel ungewaschen isst} and \emph{dass er ungewaschen die Äpfel isst}}
\end{figure}


\end{document}

문제는 화살표를 그리는 방법을 모른다는 것입니다. 첫 번째 그림 뒤에 첫 번째 그림에 대한 명령을 마지막 그림 뒤에 두 번째 그림에 대한 명령을 넣었지만 작동하지 않았습니다. 따라서 현재의 최소 예에서는 모든 그리기 명령을 마지막 그림 뒤에 두지만 이 역시 작동하지 않습니다.

여기에 이미지 설명을 입력하세요

편집하다:아래 솔루션은 texlive 2014로 업데이트하고 모든 업데이트를 수행할 때까지 제대로 작동했습니다. 이제 나는 다음을 얻습니다:

여기에 이미지 설명을 입력하세요

내가 할 수 있는게 있습니까?

답변1

잘못된 순서인 좌표를 기억한 후 크기를 조정했습니다.

여기에 이미지 설명을 입력하세요

\documentclass{article}
\usepackage{forest}

\usetikzlibrary{tikzmark}

\forestset{
sn edges/.style={for tree={parent anchor=south, child
anchor=north,align=center,base=bottom,
where n children=0{tier=word}{}}}
}


\newcommand{\spirit}[1]{%
{\renewcommand{\arraystretch}{0}%
\begin{tabular}[t]{@{}c@{}}%
\ibox{#1}\\[-3.2mm]
\large/\\%
\end{tabular}}}

\newcommand{\sliste}[1]{%
\mbox{%
$\left\langle\mbox{\upshape\scshape #1}\right\rangle$}%
}

\def\ibox#1{\mbox{}\setbox2=\hbox{$\scriptstyle #1$}\lower.2ex\vbox{\hrule
        \hbox{\vrule\kern1.25pt 
        \vbox{\kern1.25pt\box2\kern1.25pt}\kern1.25pt\vrule}\hrule}}

\begin{document}


\begin{figure}
\resizebox{\linewidth}{!}{%
\begin{forest}
sn edges, for tree={l sep= 6ex}
[V{[{\sc subcat} \sliste{ \spirit{1}, \spirit{2} }]}
        [\ibox{1} NP{[\textit{nom}]}
                [er]]
        [V{[{\sc subcat} \sliste{ \ibox{1}, \spirit{2} } ]}
                [\ibox{2} NP{[\textit{acc}]}
                        [die Äpfel,triangle]]
                [V{[{\sc subcat} \sliste{ \ibox{1}, \ibox{2} } ]}
                        [\tikzmark{ap1}{AP}
                                [ungewaschen]]
                        [V{[{\sc subcat} \sliste{ \tikzmark{arg11}{\ibox{1}}, \tikzmark{arg12}{\ibox{2}} }]}
                                [isst]]]]]
\end{forest}
\begin{forest}
sn edges, for tree={l sep= 6ex}
[V{[{\sc subcat} \sliste{ \spirit{1}, \spirit{2} } ]}
        [\ibox{1} NP{[\textit{nom}]}
                [er]]
        [V{[{\sc subcat} \sliste{ \ibox{1}, \spirit{2} } ]}
                [\tikzmark{ap2}{AP}
                        [ungewaschen]]
                [V{[{\sc subcat} \sliste{ \tikzmark{arg21}{\ibox{1}}, \spirit{2} } ]}
                        [\ibox{2} NP{[\textit{acc}]}
                                [die Äpfel,triangle]]
                        [V{[{\sc subcat} \sliste{ \ibox{1}, \ibox{2} } ]}
                                [isst]]]]]
\end{forest}
\begin{tikzpicture}[overlay,remember picture]
\draw[->, bend angle=40, bend left] ($(pic cs:ap1)+(1ex,2ex)$) to($(pic cs:arg11)+(1ex,2.5ex)$);
\draw[->, bend angle=40, bend left] ($(pic cs:ap1)+(1ex,2ex)$) to($(pic cs:arg12)+(1ex,2.5ex)$); % 1ex links, 2ex hoch
%
\draw[->, bend angle=40, bend left] ($(pic cs:ap2)+(1ex,2ex)$) to($(pic cs:arg21)+(1ex,2.5ex)$);
\end{tikzpicture}}

\caption{Analysis of \emph{dass er die Äpfel ungewaschen isst} and \emph{dass er ungewaschen die Äpfel isst}}
\end{figure}


\end{document}

관련 정보