summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/phonrule/phonrule.sty
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/phonrule/phonrule.sty
Initial commit
Diffstat (limited to 'macros/latex/contrib/phonrule/phonrule.sty')
-rw-r--r--macros/latex/contrib/phonrule/phonrule.sty65
1 files changed, 65 insertions, 0 deletions
diff --git a/macros/latex/contrib/phonrule/phonrule.sty b/macros/latex/contrib/phonrule/phonrule.sty
new file mode 100644
index 0000000000..2039c1e36a
--- /dev/null
+++ b/macros/latex/contrib/phonrule/phonrule.sty
@@ -0,0 +1,65 @@
+% phonrule.sty v1.3.2
+%
+% (c) 2013-2017 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/04/16 v1.3.2 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}[2][c]{%
+ \ensuremath{%
+ \left[\begin{tabular}{#1}#2\end{tabular}\right]%
+ }%
+}
+\newcommand*{\oneof}[2][c]{%
+ \ensuremath{%
+ \left\{
+ \begin{tabular}{#1#1}#2\end{tabular}
+ \right.
+ }%
+}
+
+\endinput
+%%
+%% End of file `phonrule.sty'.