texlive[42795] Master/texmf-dist: phonrule (26dec16)
commits+karl at tug.org
commits+karl at tug.org
Mon Dec 26 23:23:51 CET 2016
Revision: 42795
http://tug.org/svn/texlive?view=revision&revision=42795
Author: karl
Date: 2016-12-26 23:23:51 +0100 (Mon, 26 Dec 2016)
Log Message:
-----------
phonrule (26dec16)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/phonrule/phonrule-doc.pdf
trunk/Master/texmf-dist/doc/latex/phonrule/phonrule-doc.tex
trunk/Master/texmf-dist/tex/latex/phonrule/phonrule.sty
Added Paths:
-----------
trunk/Master/texmf-dist/doc/latex/phonrule/README.md
Removed Paths:
-------------
trunk/Master/texmf-dist/doc/latex/phonrule/README
Deleted: trunk/Master/texmf-dist/doc/latex/phonrule/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/phonrule/README 2016-12-26 01:05:29 UTC (rev 42794)
+++ trunk/Master/texmf-dist/doc/latex/phonrule/README 2016-12-26 22:23:51 UTC (rev 42795)
@@ -1,7 +0,0 @@
-PhonRule.sty v1.2.0
-
-(c) 2015 Stefano Coretta
-
-LPPL LaTeX Public Project License
-
-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
Added: trunk/Master/texmf-dist/doc/latex/phonrule/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/phonrule/README.md (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/phonrule/README.md 2016-12-26 22:23:51 UTC (rev 42795)
@@ -0,0 +1,7 @@
+# phonrule.sty (v1.3.0)
+
+(c) 2015 Stefano Coretta
+
+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 classical linear phonology.
Modified: trunk/Master/texmf-dist/doc/latex/phonrule/phonrule-doc.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/phonrule/phonrule-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/phonrule/phonrule-doc.tex 2016-12-26 01:05:29 UTC (rev 42794)
+++ trunk/Master/texmf-dist/doc/latex/phonrule/phonrule-doc.tex 2016-12-26 22:23:51 UTC (rev 42795)
@@ -3,14 +3,19 @@
\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
\begin{document}
@@ -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 @@
\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,20 +57,20 @@
\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.
@@ -71,18 +77,18 @@
\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:
@@ -89,84 +95,120 @@
\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 Added: \texttt{ragged2e} package for \verb+\Centering+ command
+ \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}
+\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}
Modified: trunk/Master/texmf-dist/tex/latex/phonrule/phonrule.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/phonrule/phonrule.sty 2016-12-26 01:05:29 UTC (rev 42794)
+++ trunk/Master/texmf-dist/tex/latex/phonrule/phonrule.sty 2016-12-26 22:23:51 UTC (rev 42795)
@@ -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'.
More information about the tex-live-commits
mailing list