
forest
同じ環境に2 つの図があり、両方で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}
問題は、矢印の描き方がわからないことです。最初の図のコマンドを最初の図の後に配置し、2 番目の図のコマンドを最後の図の後に配置しましたが、これは機能しませんでした。そのため、現在の最小限の例では、すべての描画コマンドを最後の図の後に配置していますが、これも機能しません。
編集:以下の解決策は、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}