Debian Codegraph @

texmf-dist/doc/latex/phonrule/phonrule-doc.tex

raw
1 \documentclass[a4paper]{article}
2
3 \usepackage{fontspec}
4
5 \usepackage{polyglossia}
6 \setmainlanguage{english}
7
8 \usepackage{listings}
9 \lstset{basicstyle=\ttfamily}
10
11 \usepackage{phonrule}
12 \usepackage{gb4e}
13
14 \title{The \texttt{phonrule} package (v1.3.2)}
15 \author{Stefano Coretta \\ \texttt{stefano.coretta \textit{at} postgrad.manchester.ac.uk}}
16
17 \reversemarginpar
18
19 \begin{document}
20 \maketitle
21
22 \section{Purpose}
23 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).
24
25 \section{Usage}
26
27 \begin{quote}
28 \begin{lstlisting}
29 \phon{〈input〉}{〈output〉}
30 \end{lstlisting}
31 \end{quote}
32
33 The command \verb+\phon+ has two arguments: the first one is the input of the rule and the second is its output.
34 Here is an example with the code and the result it produces:
35
36 \begin{exe}
37 \ex \verb+\phon{z}{r}+
38 \ex \phon{z}{r}
39 \end{exe}
40
41 \begin{quote}
42 \begin{lstlisting}
43 \phonc{〈input〉}{〈output〉}{〈context〉}
44 \end{lstlisting}
45 \end{quote}
46
47 \verb+\phonc+ adds a third argument for the context:
48
49 \begin{exe}
50 \ex \verb+\phonc{a}{ə}{[–stressed]}+
51 \ex \phonc{a}{ə}{[–stressed]}
52 \end{exe}
53
54 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):
55
56 \begin{exe}
57 \ex
58 \begin{xlist}
59 \ex \verb+\phonl{k}{c}{i}+
60 \ex \phonl{k}{tʃ}{i}
61 \end{xlist}
62 \ex
63 \begin{xlist}
64 \ex \verb+\phonr{t}{ts}{u}+
65 \ex \phonr{t}{ts}{u}
66 \end{xlist}
67 \ex
68 \begin{xlist}
69 \ex \verb+\phonb{s}{z}{V}{V}+
70 \ex \phonb{s}{z}{V}{V}
71 \end{xlist}
72 \end{exe}
73
74 The \verb+\oneof+ command provides the possibility to compile several contexts, one per line, embraced by a left curly bracket.
75
76 \begin{exe}
77 \ex
78 \begin{lstlisting}
79 \phonc{t}{ts}{
80 \oneof{
81 \phold i \\
82 \phold u}
83 }
84 \end{lstlisting}
85 \ex \phonc{t}{ts}{
86 \oneof{
87 \phold i \\
88 \phold u}
89 }
90 \end{exe}
91
92 The \verb+\phonfeat+ command allows you to insert feature specifications.
93 The possible values are \texttt{[c]} for centre (the default), \texttt{[l]} for left-aligned, and \texttt{[r]} for right-aligned.
94
95 \begin{exe}
96 \ex
97 \begin{lstlisting}
98 \phonc{t}{ts}{\phold
99 \phonfeat[l]{
100 −consonantal \\
101 +high \\
102 +front}
103 }
104 \end{lstlisting}
105 \ex \phonc{t}{ts}{\phold
106 \phonfeat[l]{
107 −consonantal \\
108 +high \\
109 +front}
110 }
111 \end{exe}
112
113 \verb+\phold+ typesets a place holder line. You can nest \verb|oneof| and \verb|phonfeat| commands for complex rules.
114 The \verb|oneof| command accepts an optional argument which tells the alignment of the context.
115
116 \begin{exe}
117 \ex
118 \begin{lstlisting}
119 \phonc{x}{y}{\oneof[l]{
120 \phold z \\
121 \phonfeat{
122 +feature x \\
123 −feature y
124 } \phold
125 }}
126 \end{lstlisting}
127 \ex \phonc{x}{y}{\oneof{
128 \phold z \\
129 \phonfeat{
130 +feature x \\
131 −feature y
132 } \phold
133 }}
134 \end{exe}
135
136 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.
137 The possible values are \texttt{[c]} for centre (the default), \texttt{[l]} for left-aligned, and \texttt{[r]} for right-aligned.
138 The following example shows the use of the optional argument with \texttt{[l]}.
139 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|.
140
141 \begin{exe}
142 \ex
143 \begin{lstlisting}
144 \phon{x}{\oneof[l]{
145 \envr*{w}{z} \\
146 \envl*{v}{\phonfeat{
147 +feature x \\
148 −feature y
149 }}}}
150 \end{lstlisting}
151 \ex \phon{x}{\oneof[l]{
152 \envr*{w}{z} \\
153 \envl*{v}{\phonfeat{
154 +feature x \\
155 −feature y
156 }}}}
157 \end{exe}
158
159 \section{Change log}
160
161 \subsection*{v1.3.2 - 2017-04-16}
162 \subsubsection*{Added}
163 \begin{itemize}
164 \item optional argument for text alignment in \verb+\phonfeat+ command
165 \end{itemize}
166
167 \subsection*{v1.3.1 - 2017-01-02}
168 \subsubsection*{Added}
169 \begin{itemize}
170 \item needs \TeX{} format \LaTeX2e
171 \end{itemize}
172 \subsubsection*{Removed}
173 \begin{itemize}
174 \item \verb+\makeatletter+
175 \item unused definition
176 \end{itemize}
177
178 \subsection*{v1.3.0 - 2016-12-26}
179 \subsubsection*{Added}
180 \begin{itemize}
181 \item optional argument for text alignment in \verb+\oneof+ command
182 \item starred version of the \verb+\env+ command family for use with optional argument in \verb+\oneof+
183 \end{itemize}
184 \subsubsection*{Changed}
185 \begin{itemize}
186 \item definition of \verb+\phon+ command family
187 \item header of \texttt{phonrule.sty}
188 \item extension of README, now \texttt{.md}
189 \end{itemize}
190 \subsubsection*{Removed}
191 \begin{itemize}
192 \item package \texttt{ragged2e}
193 \end{itemize}
194
195 \subsection*{v1.2.0}
196 \subsubsection*{Added}
197 \begin{itemize}
198 \item \texttt{ragged2e} package for \verb+\Centering+ command
199 \end{itemize}
200 \subsubsection*{Fixed}
201 \begin{itemize}
202 \item Fixed: now the content of the feature matrices is centred and not left aligned
203 \end{itemize}
204
205 \subsection*{v1.1.0}
206 \subsubsection*{Changed}
207 \begin{itemize}
208 \item definition of \verb+\phonfeat+ and \verb+\oneof+ with \verb+\pbox+ (requires package \texttt{pbox})
209 \subsubsection*{Fixed}
210 \item documentation typos
211 \end{itemize}
212
213 \subsection*{v1.0.0}
214 \subsubsection*{Added}
215 \begin{itemize}
216 \item new commands \verb|\env| for personalised outputs
217 \end{itemize}
218
219 \subsubsection*{Changed}
220 \begin{itemize}
221 \item definition of commands with \verb|\ensuremath|
222 \item environments to commands
223 \item place holder to 1.5ex length, -1.5pt vertical position
224 \item curly brackets to only left in \verb|\oneof| command
225 \end{itemize}
226
227
228
229
230 \end{document}