% phonrule.sty v1.3.1
%
% (c) 2016 Stefano Coretta
%
% This program can redistributed and/or modified under the terms
% of the LaTeX Project Public License Distributed from CTAN
% archives in directory macros/latex/base/lppl.txt; either
% version 1 of the License, or (at your option) any later version.
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{phonrule}
  [2017/01/02 v1.3.1 LaTeX package for typesetting phonological rules]

\newcommand{\phold}{\rule[-1.5pt]{1.5ex}{.5pt}}
\newcommand{\parrow}{\ensuremath{\rightarrow}}

\newcommand{\phon} [3][\parrow] {#2 #1 #3}
\newcommand{\phonc} [4][\parrow] {#2 #1 #3~\ensuremath{/}~#4}
\newcommand{\phonr} [4][\parrow] {#2 #1 #3~\ensuremath{/}~\phold#4}
\newcommand{\phonl} [4][\parrow] {#2 #1 #3~\ensuremath{/}~#4\phold}
\newcommand{\phonb} [5][\parrow] {#2 #1 #3~\ensuremath{/}~#4\phold#5}

\newcommand*{\env}{%
    \@ifstar
        {\@env{&}}
        {\@env{~}}%
    }
\newcommand*{\@env}[3]{#2~/#1#3}

\newcommand*{\envr}{%
    \@ifstar
        {\@envr{&}}
        {\@envr{~}}%
    }
\newcommand*{\@envr}[3]{\@env{#1}{#2}{\phold#3}}

\newcommand*{\envl}{%
    \@ifstar
        {\@envl{&}}
        {\@envl{~}}%
    }
\newcommand*{\@envl}[3]{\@env{#1}{#2}{#3\phold}}

\newcommand*{\envb}{%
    \@ifstar
        {\@envb{&}}
        {\@envb{~}}%
    }
\newcommand*{\@envb}[4]{\@env{#1}{#2}{#3\phold#4}}

\newcommand*{\phonfeat}[1]{%
  \ensuremath{%
    \left[\begin{tabular}{c}#1\end{tabular}\right]%
  }%
}
\newcommand*{\oneof}[2][c]{%
  \ensuremath{%
    \left\{
    \begin{tabular}{#1#1}#2\end{tabular}
    \right.
  }%
}

\endinput
%%
%% End of file `phonrule.sty'.
