Skip to content

Instantly share code, notes, and snippets.

@tetsuok
Created June 23, 2012 20:18
Show Gist options
  • Select an option

  • Save tetsuok/2979810 to your computer and use it in GitHub Desktop.

Select an option

Save tetsuok/2979810 to your computer and use it in GitHub Desktop.
An example of English-Japanese pair with human-annotated parse trees and word alignments
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
% Note: works only for XeLaTeX and tikz-qtree 1.2.
\documentclass{beamer}
\usepackage{tikz}
\usepackage{tikz-qtree}
\setbeamertemplate{navigation symbols}{} %no nav symbols
\usepackage{zxjatype}
\setjamainfont[Scale=0.8]{Hiragino Kaku Gothic Pro W3}
\setmainfont[Mapping=tex-text,Scale=MatchLowercase]{Helvetica} % \sffamily
\setsansfont[Scale=MatchLowercase]{Helvetica} % \sffamily のフォント
\usepackage{xltxtra}
\begin{document}
\begin{frame}
\begin{center}
\begin{tikzpicture}
\begin{scope}[xshift=1cm]
\tikzset{frontier/.style={distance from root=4.2cm}}
\Tree [.S [.NP [.PRP \node (e1) {she}; ]]
[.VP [.VBD \node (e2) {broke}; ]
[.NP [.DT \node (e3) {the}; ] [.NN \node (e4) {school}; ] [.NNS \node (e5) {windows}; ] ] ] ]
\end{scope}
\begin{scope}[yshift=-6cm]
\foreach \id/\w in {1/彼女, 2/は, 3/学校, 4/の, 5/窓ガラス, 6/を, 7/割った} {
\node (ja\id) at (\id-1,0) {\w};
}
\end{scope}
\begin{scope}[dashed]
\draw (e1) -- (ja1);
\draw (e2) -- (ja7);
\draw (e4) -- (ja3);
\draw (e5) -- (ja5);
\end{scope}
\end{tikzpicture}
\end{center}
\end{frame}
\end{document}
%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment