summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-12-26 22:23:51 +0000
committerKarl Berry <karl@freefriends.org>2016-12-26 22:23:51 +0000
commit6a2618ff9e74e2551b6d705dcf4c9e79c2e6cb2e (patch)
tree96aa854a732dc2d9be81f7b5906931b0259f7312 /Master/texmf-dist
parent324db728be580337c74baae4a46447b3f1774fd3 (diff)
phonrule (26dec16)
git-svn-id: svn://tug.org/texlive/trunk@42795 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/doc/latex/phonrule/README.md (renamed from Master/texmf-dist/doc/latex/phonrule/README)6
-rw-r--r--Master/texmf-dist/doc/latex/phonrule/phonrule-doc.pdfbin36682 -> 41932 bytes
-rw-r--r--Master/texmf-dist/doc/latex/phonrule/phonrule-doc.tex216
-rw-r--r--Master/texmf-dist/tex/latex/phonrule/phonrule.sty84
4 files changed, 194 insertions, 112 deletions
diff --git a/Master/texmf-dist/doc/latex/phonrule/README b/Master/texmf-dist/doc/latex/phonrule/README.md
index dbe2c065d43..3906daf4a52 100644
--- a/Master/texmf-dist/doc/latex/phonrule/README
+++ b/Master/texmf-dist/doc/latex/phonrule/README.md
@@ -1,7 +1,7 @@
-PhonRule.sty v1.2.0
+# phonrule.sty (v1.3.0)
(c) 2015 Stefano Coretta
-LPPL LaTeX Public Project License
+LPPL LaTeX Public Project License 1.0
-This packages provides macros for typesetting phonological rules like those in Sound Pattern of English (Chomsky and Halle 1968). It is recommended for linear phonological works. \ No newline at end of file
+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.
diff --git a/Master/texmf-dist/doc/latex/phonrule/phonrule-doc.pdf b/Master/texmf-dist/doc/latex/phonrule/phonrule-doc.pdf
index b3d58cfc364..c68b58608ce 100644
--- a/Master/texmf-dist/doc/latex/phonrule/phonrule-doc.pdf
+++ b/Master/texmf-dist/doc/latex/phonrule/phonrule-doc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/phonrule/phonrule-doc.tex b/Master/texmf-dist/doc/latex/phonrule/phonrule-doc.tex
index 1a14dde6431..00009e520d7 100644
--- a/Master/texmf-dist/doc/latex/phonrule/phonrule-doc.tex
+++ b/Master/texmf-dist/doc/latex/phonrule/phonrule-doc.tex
@@ -3,13 +3,18 @@
\usepackage{fontspec}
\usepackage{polyglossia}
- \setmainlanguage{english}
+ \setmainlanguage{english}
+
+\usepackage{listings}
+ \lstset{basicstyle=\ttfamily}
\usepackage{phonrule}
\usepackage{gb4e}
-\title{The \texttt{phonrule} package (v1.2.0)}
-\author{Stefano Coretta \\ \texttt{stefano.coretta \textit{at} me.com}}
+
+
+\title{The \texttt{phonrule} package (v1.3.0)}
+\author{Stefano Coretta \\ \texttt{stefano.coretta \textit{at} postgrad.manchester.ac.uk}}
\reversemarginpar
@@ -17,17 +22,18 @@
\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).
+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{verbatim}
+\begin{lstlisting}
\phon{〈input〉}{〈output〉}
-\end{verbatim}
+\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:
+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}+
@@ -35,9 +41,9 @@ The command \verb+\phon+ has two arguments: the first one is the input of the ru
\end{exe}
\begin{quote}
-\begin{verbatim}
+\begin{lstlisting}
\phonc{〈input〉}{〈output〉}{〈context〉}
-\end{verbatim}
+\end{lstlisting}
\end{quote}
\verb+\phonc+ adds a third argument for the context:
@@ -51,122 +57,158 @@ The commands \verb+\phonl+, \verb+\phonr+ and \verb+\phonb+ add a place holder l
\begin{exe}
\ex
- \begin{xlist}
- \ex \verb+\phonl{k}{c}{i}+
- \ex \phonl{k}{tʃ}{i}
- \end{xlist}
+ \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}
+ \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}
+ \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{verbatim}
+\begin{lstlisting}
\phonc{t}{ts}{
- \oneof{
- \phold i \\
- \phold u}
- }
-\end{verbatim}
+ \oneof{
+ \phold i \\
+ \phold u}
+ }
+\end{lstlisting}
\ex \phonc{t}{ts}{
- \oneof{
- \phold i \\
- \phold u}
- }
+ \oneof{
+ \phold i \\
+ \phold u}
+ }
\end{exe}
The \verb+\phonfeat+ command allows you to insert feature specifications:
\begin{exe}
\ex
-\begin{verbatim}
-\phonc{t}{ts}{\phold
- \phonfeat{
- −consonantal \\
- +high \\
- +front}
- }
-\end{verbatim}
-\ex \phonc{t}{ts}{\phold
- \phonfeat{
- −consonantal \\
- +high \\
- +front}
- }
+\begin{lstlisting}
+\phonc{t}{ts}{\phold
+ \phonfeat{
+ −consonantal \\
+ +high \\
+ +front}
+ }
+\end{lstlisting}
+\ex \phonc{t}{ts}{\phold
+ \phonfeat{
+ −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{verbatim}
-\phonc{x}{y}{\oneof{
- \phold z \\
- \phonfeat{
- +feature x \\
- −feature y
- } \phold
- }}
-\end{verbatim}
+\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
- }}
+ \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{verbatim}
-\phon{x}{\oneof{
- \envr{w}{z} \\
- \envl{v}{\phonfeat{
- +feature x \\
- −feature y
- }}}}
-\end{verbatim}
-\ex \phon{x}{\oneof{
- \envr{w}{z} \\
- \envl{v}{\phonfeat{
- +feature x \\
- −feature y
- }}}}
+\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{Changelog}
-\subsection{v1.2.0}
+\section{Change log}
+
+\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 Added: \texttt{ragged2e} package for \verb+\Centering+ command
\item Fixed: now the content of the feature matrices is centred and not left aligned
\end{itemize}
-\subsection{v1.1.0}
+\subsection*{v1.1.0}
+\subsubsection*{Changed}
\begin{itemize}
-\item Changed: definition of \verb+\phonfeat+ and \verb+\oneof+ with \verb+\pbox+ (requires package \texttt{pbox})
-\item Fixed: documentation typos
+\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}
+\subsection*{v1.0.0}
+\subsubsection*{Added}
\begin{itemize}
-\item Added: new commands \verb|\env| for personalised outputs
-\item Changed: definition of commands with \verb|\ensuremath|
-\item Changed: environments to commands
-\item Changed: place holder to 1.5ex length, -1.5pt vertical position
-\item Changed: curly brackets to only left in \verb|\oneof| command
+\item new commands \verb|\env| for personalised outputs
\end{itemize}
-\end{document} \ No newline at end of file
+\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/Master/texmf-dist/tex/latex/phonrule/phonrule.sty b/Master/texmf-dist/tex/latex/phonrule/phonrule.sty
index f519fefe1e3..ac4c19115c8 100644
--- a/Master/texmf-dist/tex/latex/phonrule/phonrule.sty
+++ b/Master/texmf-dist/tex/latex/phonrule/phonrule.sty
@@ -1,28 +1,68 @@
-% PhonRule
-%
-% (c) 2015 Stefano Coretta
-% LPPL LaTeX Public Project License
-%
+% phonrule.sty v1.3.0
+%
+% (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.
\ProvidesPackage{phonrule}
- [2015/07/04 v1.2.0 LaTeX package for typesetting phonological rules]
-
-\RequirePackage{pbox}
-\RequirePackage{ragged2e}
+ [2016/12/26 v1.3.0 LaTeX package for typesetting phonological rules]
+
\let\myDate\date
-\newcommand{\phon} [2] {#1 \ensuremath{\rightarrow} #2}
-\newcommand{\phonc} [3] {#1 \ensuremath{\rightarrow} #2 \ensuremath{/} #3}
-\newcommand{\phonr} [3] {#1 \ensuremath{\rightarrow} #2 \ensuremath{/} \rule[-1.5pt]{1.5ex}{.5pt}#3}
-\newcommand{\phonl} [3] {#1 \ensuremath{\rightarrow} #2 \ensuremath{/} #3\rule[-1.5pt]{1.5ex}{.5pt}}
-\newcommand{\phonb} [4] {#1 \ensuremath{\rightarrow} #2 \ensuremath{/} #3\rule[-1.5pt]{1.5ex}{.5pt}#4}
-\newcommand{\phold}{\rule[-1.5pt]{1.5ex}{.5pt}} % for place holder without spaces
-\newcommand{\env} [2] {#1 \ensuremath{/} #2}
-\newcommand{\envr} [2] {#1 \ensuremath{/} \rule[-1.5pt]{1.5ex}{.5pt}#2}
-\newcommand{\envl} [2] {#1 \ensuremath{/} #2\rule[-1.5pt]{1.5ex}{.5pt}}
-\newcommand{\envb} [3] {#1 \ensuremath{/} #2\rule[-1.5pt]{1.5ex}{.5pt}#3}
-\newcommand{\phonfeat}[1]{\ensuremath{\left[\begin{array}{c} \pbox{\textwidth}{\Centering #1} \end{array}\right]}} % set environment for feature matrix with square brackets
-\newcommand{\oneof}[1]{\ensuremath{\left\{\begin{array}{l} \pbox{\textwidth}{\Centering #1} \end{array}\right.}} % set environment for one of multiple with curly brackets
+
+\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}
+
+\makeatletter
+\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'. \ No newline at end of file
+%% End of file `phonrule.sty'.