From e0c6872cf40896c7be36b11dcc744620f10adf1d Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 2 Sep 2019 13:46:59 +0900 Subject: Initial commit --- macros/latex/contrib/phonrule/phonrule.sty | 65 ++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 macros/latex/contrib/phonrule/phonrule.sty (limited to 'macros/latex/contrib/phonrule/phonrule.sty') 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'. -- cgit v1.2.3