Skip to content

Instantly share code, notes, and snippets.

@tetsuok
Created December 8, 2012 20:02
Show Gist options
  • Select an option

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

Select an option

Save tetsuok/4241676 to your computer and use it in GitHub Desktop.
A French sentence aligned with an English parse tree.
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.
% Figure from (Galley et al., 2004)
\documentclass{standalone}
\usepackage{tikz}
\usepackage{tikz-qtree}
\usepackage{xltxtra}
% Works only for XeLaTeX
\setmainfont[Mapping=tex-text,ItalicFont={Gill Sans Light}]{Gill Sans}
\begin{document}
\begin{tikzpicture}[level distance=25pt]
\tikzset{every leaf node/.style={font=\it}}
\begin{scope}
\Tree [.S [.NP [.PRP \node (en-1) {he}; ] ]
[.VP [.AUX \node (en-2) {does}; ]
[.RB \node (en-3) {not}; ]
[.VB \node (en-4) {go}; ] ] ]
\end{scope}
\begin{scope}[yshift=-4cm]
\foreach \id/\w in {1/il, 2/ne, 3/va, 4/pas} {
\node (fr-\id) at (\id-2,0) {\it \w};
}
\end{scope}
\begin{scope}[thick, dashed, draw=blue]
\draw (en-1) -- (fr-1);
\draw (en-3) -- (fr-2);
\draw (en-3) -- (fr-4);
\draw (en-4) -- (fr-3);
\end{scope}
\end{tikzpicture}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment