Created
June 23, 2012 18:24
-
-
Save tetsuok/2979324 to your computer and use it in GitHub Desktop.
Draw word alignment matrix.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| % Note: works only for XeLaTeX. | |
| \documentclass[border=1mm]{standalone} | |
| \usepackage{tikz} | |
| \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{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/彼女, 1/は, 2/学校, 3/の, 4/窓ガラス, 5/を, 6/割った} { | |
| \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: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you. This is great!