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/README.md | 12 ++ macros/latex/contrib/phonrule/phonrule-doc.pdf | Bin 0 -> 43917 bytes macros/latex/contrib/phonrule/phonrule-doc.tex | 230 +++++++++++++++++++++++++ macros/latex/contrib/phonrule/phonrule.sty | 65 +++++++ 4 files changed, 307 insertions(+) create mode 100644 macros/latex/contrib/phonrule/README.md create mode 100644 macros/latex/contrib/phonrule/phonrule-doc.pdf create mode 100644 macros/latex/contrib/phonrule/phonrule-doc.tex create mode 100644 macros/latex/contrib/phonrule/phonrule.sty (limited to 'macros/latex/contrib/phonrule') diff --git a/macros/latex/contrib/phonrule/README.md b/macros/latex/contrib/phonrule/README.md new file mode 100644 index 0000000000..00960958f0 --- /dev/null +++ b/macros/latex/contrib/phonrule/README.md @@ -0,0 +1,12 @@ +# phonrule.sty (v1.3.2) + +(c) 2013-2017 Stefano Coretta + +This packages provides macros for typesetting phonological rules like those in Sound Pattern of English (Chomsky and Halle 1968). It is recommended for classical linear phonology. + +## License + +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. diff --git a/macros/latex/contrib/phonrule/phonrule-doc.pdf b/macros/latex/contrib/phonrule/phonrule-doc.pdf new file mode 100644 index 0000000000..f27ea81a73 Binary files /dev/null and b/macros/latex/contrib/phonrule/phonrule-doc.pdf differ diff --git a/macros/latex/contrib/phonrule/phonrule-doc.tex b/macros/latex/contrib/phonrule/phonrule-doc.tex new file mode 100644 index 0000000000..b4c88e5fb3 --- /dev/null +++ b/macros/latex/contrib/phonrule/phonrule-doc.tex @@ -0,0 +1,230 @@ +\documentclass[a4paper]{article} + +\usepackage{fontspec} + +\usepackage{polyglossia} + \setmainlanguage{english} + +\usepackage{listings} + \lstset{basicstyle=\ttfamily} + +\usepackage{phonrule} +\usepackage{gb4e} + +\title{The \texttt{phonrule} package (v1.3.2)} +\author{Stefano Coretta \\ \texttt{stefano.coretta \textit{at} postgrad.manchester.ac.uk}} + +\reversemarginpar + +\begin{document} +\maketitle + +\section{Purpose} +This package provides macros for typesetting phonological rules like those in \textit{Sound Pattern of English} (Chomsky, Noam \& Morris Halle. 1968.\textit{The sound pattern of English}. New York, Evanston, and London: Harper \& Row). + +\section{Usage} + +\begin{quote} +\begin{lstlisting} +\phon{〈input〉}{〈output〉} +\end{lstlisting} +\end{quote} + +The command \verb+\phon+ has two arguments: the first one is the input of the rule and the second is its output. +Here is an example with the code and the result it produces: + +\begin{exe} +\ex \verb+\phon{z}{r}+ +\ex \phon{z}{r} +\end{exe} + +\begin{quote} +\begin{lstlisting} +\phonc{〈input〉}{〈output〉}{〈context〉} +\end{lstlisting} +\end{quote} + +\verb+\phonc+ adds a third argument for the context: + +\begin{exe} +\ex \verb+\phonc{a}{ə}{[–stressed]}+ +\ex \phonc{a}{ə}{[–stressed]} +\end{exe} + +The commands \verb+\phonl+, \verb+\phonr+ and \verb+\phonb+ add a place holder line and put the context, respectively, on the left (l), on the right (r) and on both sides (b): + +\begin{exe} +\ex + \begin{xlist} + \ex \verb+\phonl{k}{c}{i}+ + \ex \phonl{k}{tʃ}{i} + \end{xlist} +\ex + \begin{xlist} + \ex \verb+\phonr{t}{ts}{u}+ + \ex \phonr{t}{ts}{u} + \end{xlist} +\ex + \begin{xlist} + \ex \verb+\phonb{s}{z}{V}{V}+ + \ex \phonb{s}{z}{V}{V} + \end{xlist} +\end{exe} + +The \verb+\oneof+ command provides the possibility to compile several contexts, one per line, embraced by a left curly bracket. + +\begin{exe} +\ex +\begin{lstlisting} +\phonc{t}{ts}{ + \oneof{ + \phold i \\ + \phold u} + } +\end{lstlisting} +\ex \phonc{t}{ts}{ + \oneof{ + \phold i \\ + \phold u} + } +\end{exe} + +The \verb+\phonfeat+ command allows you to insert feature specifications. +The possible values are \texttt{[c]} for centre (the default), \texttt{[l]} for left-aligned, and \texttt{[r]} for right-aligned. + +\begin{exe} +\ex +\begin{lstlisting} +\phonc{t}{ts}{\phold + \phonfeat[l]{ + −consonantal \\ + +high \\ + +front} + } +\end{lstlisting} +\ex \phonc{t}{ts}{\phold + \phonfeat[l]{ + −consonantal \\ + +high \\ + +front} + } +\end{exe} + +\verb+\phold+ typesets a place holder line. You can nest \verb|oneof| and \verb|phonfeat| commands for complex rules. +The \verb|oneof| command accepts an optional argument which tells the alignment of the context. + +\begin{exe} +\ex +\begin{lstlisting} +\phonc{x}{y}{\oneof[l]{ + \phold z \\ + \phonfeat{ + +feature x \\ + −feature y + } \phold + }} +\end{lstlisting} +\ex \phonc{x}{y}{\oneof{ + \phold z \\ + \phonfeat{ + +feature x \\ + −feature y + } \phold + }} +\end{exe} + +You can use \verb|\env|, \verb|\envl|, \verb|\envr|, \verb|\envb| for rules with more than one output: these commands typeset only the different outputs with their respective environments. +The possible values are \texttt{[c]} for centre (the default), \texttt{[l]} for left-aligned, and \texttt{[r]} for right-aligned. +The following example shows the use of the optional argument with \texttt{[l]}. +The \verb|\env|, \verb|\envl|, \verb|\envr|, \verb|\envb| have a starred version to be used when an optional argument is set in \verb|\oneof|. + +\begin{exe} +\ex +\begin{lstlisting} +\phon{x}{\oneof[l]{ + \envr*{w}{z} \\ + \envl*{v}{\phonfeat{ + +feature x \\ + −feature y + }}}} +\end{lstlisting} +\ex \phon{x}{\oneof[l]{ + \envr*{w}{z} \\ + \envl*{v}{\phonfeat{ + +feature x \\ + −feature y + }}}} +\end{exe} + +\section{Change log} + +\subsection*{v1.3.2 - 2017-04-16} +\subsubsection*{Added} +\begin{itemize} + \item optional argument for text alignment in \verb+\phonfeat+ command +\end{itemize} + +\subsection*{v1.3.1 - 2017-01-02} +\subsubsection*{Added} +\begin{itemize} + \item needs \TeX{} format \LaTeX2e +\end{itemize} +\subsubsection*{Removed} +\begin{itemize} + \item \verb+\makeatletter+ + \item unused definition +\end{itemize} + +\subsection*{v1.3.0 - 2016-12-26} +\subsubsection*{Added} +\begin{itemize} + \item optional argument for text alignment in \verb+\oneof+ command + \item starred version of the \verb+\env+ command family for use with optional argument in \verb+\oneof+ +\end{itemize} +\subsubsection*{Changed} +\begin{itemize} + \item definition of \verb+\phon+ command family + \item header of \texttt{phonrule.sty} + \item extension of README, now \texttt{.md} +\end{itemize} +\subsubsection*{Removed} +\begin{itemize} + \item package \texttt{ragged2e} +\end{itemize} + +\subsection*{v1.2.0} +\subsubsection*{Added} +\begin{itemize} +\item \texttt{ragged2e} package for \verb+\Centering+ command +\end{itemize} +\subsubsection*{Fixed} +\begin{itemize} +\item Fixed: now the content of the feature matrices is centred and not left aligned +\end{itemize} + +\subsection*{v1.1.0} +\subsubsection*{Changed} +\begin{itemize} +\item definition of \verb+\phonfeat+ and \verb+\oneof+ with \verb+\pbox+ (requires package \texttt{pbox}) +\subsubsection*{Fixed} +\item documentation typos +\end{itemize} + +\subsection*{v1.0.0} +\subsubsection*{Added} +\begin{itemize} +\item new commands \verb|\env| for personalised outputs +\end{itemize} + +\subsubsection*{Changed} +\begin{itemize} +\item definition of commands with \verb|\ensuremath| +\item environments to commands +\item place holder to 1.5ex length, -1.5pt vertical position +\item curly brackets to only left in \verb|\oneof| command +\end{itemize} + + + + +\end{document} 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