From 277b30bec6f5fcfa16446c7a912d1268fa798be0 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 12 Apr 2010 23:01:12 +0000 Subject: new latex package ot-tableau (11apr10) git-svn-id: svn://tug.org/texlive/trunk@17829 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/tex/latex/ot-tableau/ot-tableau.sty | 61 ++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 Master/texmf-dist/tex/latex/ot-tableau/ot-tableau.sty (limited to 'Master/texmf-dist/tex/latex/ot-tableau') 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}&\ipa{#2}\gdef\Excl{no}} +\WithSuffix\newcommand\cand*[2][]{\properlines\ifthenelse{\equal{\fingerfirst}{yes}}{#1&\rowletter}{\rowletter}\gdef\Excl{no}} + +\def\vio#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]{\UnshadeTheCell} + + +% \begin{tableau}{c:c} +% \inp{input} \constraint{One} \constraint{Two} +% \cand{input} \vio{*!} \vio{*} +% \optcand{inp\super hut} \vio{} \vio{*} +% \end{tableau} -- cgit v1.2.3