summaryrefslogtreecommitdiff
path: root/templates/latex/word-alignment.tex
blob: b836cfce464bc899f58729a83cf188d5d7640238 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
% Note: works only for XeLaTeX.
\documentclass[border=1mm]{standalone}
\usepackage{tikz}
\usepackage{xltxtra}

\begin{document}
\begin{tikzpicture}[scale=0.7]
  \tikzstyle{vertex}=[rectangle,rounded corners, fill=red!80!white,draw=red!70!black,
  minimum size=0.6cm,line width=1]
  \draw[step=1cm,draw=gray] (0,0) grid (5,7);

  \foreach \y/\f in {0/a, 1/b, 2/c, 3/d, 4/e, 5/f, 6/g} {
    \node[left] at (-.2,6.5-\y) {{\raggedleft \f }};
  }

  \foreach \x/\e in {0/she, 1/broke, 2/the, 3/school, 4/windows} {
    \node[rotate=60,right] at (\x+.4,7.2) {{\raggedright \e}};
  }

  % draw word alignment
  \foreach \x/\y in {0/0, 1/6, 3/2, 4/4} {
    \node[vertex] at (\x+.5, 6.5-\y) {};
  }
\end{tikzpicture}
\end{document}

%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End: