summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/ot-tableau
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-04-12 23:01:12 +0000
committerKarl Berry <karl@freefriends.org>2010-04-12 23:01:12 +0000
commit277b30bec6f5fcfa16446c7a912d1268fa798be0 (patch)
tree3c8e2f9059dc7b505dfc0412602cef21fa6c5873 /Master/texmf-dist/tex/latex/ot-tableau
parente6b5908820f5cc3db4919ab1e0aa4ec435ae9d19 (diff)
new latex package ot-tableau (11apr10)
git-svn-id: svn://tug.org/texlive/trunk@17829 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/ot-tableau')
-rw-r--r--Master/texmf-dist/tex/latex/ot-tableau/ot-tableau.sty61
1 files changed, 61 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/ot-tableau/ot-tableau.sty b/Master/texmf-dist/tex/latex/ot-tableau/ot-tableau.sty
new file mode 100644
index 00000000000..1d082ae13ca
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/ot-tableau/ot-tableau.sty
@@ -0,0 +1,61 @@
+% Note that tableau requires arydshln, which must be loaded after longtable
+
+\ProvidesPackage{ot-tableau}
+
+\RequirePackage{tipa,ifthen,pifont,substr,bbding,suffix}
+\RequirePackage{colortbl}
+\RequirePackage{arydshln}
+
+% IPA typesetting macros
+\def\ipa#1{\textipa{#1}}
+\def\ip#1{[\textipa{#1}]}
+\def\ips#1{/\textipa{#1}/}
+
+% OT tableaux
+\newcounter{tableaurow}
+
+\newcolumntype{s}{>{\ShadeTheCell}c}
+
+
+\def\ShadedCells{no}
+\def\ShadingOn{\def\ShadedCells{yes}}
+\def\ShadingOff{\def\ShadedCells{no}}
+
+\def\CellShading{0.9}
+\def\SetCellShading#1{\def\CellShading{#1}}
+\def\ShadeTheCell{\cellcolor[gray]{\CellShading}}
+
+\def\UnshadeTheCell{\cellcolor[gray]{1}}
+
+\def\Excl{no}
+
+\def\fingerfirst{yes}
+\def\FingerBeforeLetter{\def\fingerfirst{yes}}
+\def\LetterBeforeFinger{\def\fingerfirst{no}}
+
+\newcommand*{\rowletter}{\stepcounter{tableaurow}\alph{tableaurow}. }
+\newenvironment{tableau}[1]{\setcounter{tableaurow}{0}%
+ \dashlinegap=2pt%
+ \ifthenelse{\equal{\fingerfirst}{yes}}%
+ {\begin{tabular}{|r@{\hspace{4pt}}l@{\hspace{3pt}}l||#1|}}%then
+ {\begin{tabular}{|l@{\hspace{2pt}}r@{\hspace{4pt}}l||#1|}}%else
+ }{\\\hline\end{tabular}}
+
+\def\properlines{\ifthenelse{\thetableaurow=0}{\\\hline\hline}{\\\hline}}
+
+\newcommand\cand[2][]{\properlines\ifthenelse{\equal{\fingerfirst}{yes}}{#1&\rowletter}{\rowletter&#1}&\ipa{#2}\gdef\Excl{no}}
+\WithSuffix\newcommand\cand*[2][]{\properlines\ifthenelse{\equal{\fingerfirst}{yes}}{#1&\rowletter}{\rowletter&#1}&#2\gdef\Excl{no}}
+
+\def\vio#1{&#1\ifthenelse{\equal{\Excl}{yes}\and\equal{\ShadedCells}{yes}}{\ShadeTheCell}{}\ifthenelse{\equal{\Excl}{yes}}{}{\IfSubStringInString{!}{#1}{\gdef\Excl{yes}}{\gdef\Excl{no}}}}
+
+\newcommand\inp[1]{\hline\multicolumn{3}{|l||}{#1}}
+
+\newcommand\const[1]{&\textsc{#1}\UnshadeTheCell}
+\WithSuffix\newcommand\const*[1]{&#1\UnshadeTheCell}
+
+
+% \begin{tableau}{c:c}
+% \inp{input} \constraint{One} \constraint{Two}
+% \cand{input} \vio{*!} \vio{*}
+% \optcand{inp\super hut} \vio{} \vio{*}
+% \end{tableau}