summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/phonrule/phonrule-doc.tex
blob: cf1e3aada51b6b0ab362b17bfcbe90b3612f9b42 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
\documentclass[a4paper]{article}

\usepackage{fontspec}

\usepackage{polyglossia}
	\setmainlanguage{english}

\usepackage{phonrule}
\usepackage{gb4e}

\title{The \texttt{phonrule} package (v1.0.0)}
\author{Stefano Coretta \\ \texttt{stefano.coretta@me.com}}

\reversemarginpar

\begin{document}
\maketitle

\section{Purpose}
This packages 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}
\phon{〈input〉}{〈output〉}
\end{verbatim}
\end{quote}

The command \verb+\phon+ has two arguments: the first one is the input of the rule and the second is the output. Here is an example with code and result:

\begin{exe}
\ex \verb+\phon{z}{r}+
\ex \phon{z}{r}
\end{exe}

\section{Usage}
\begin{quote}
\begin{verbatim}
\phonc{〈input〉}{〈output〉}{〈context〉}
\end{verbatim}
\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 the left curly bracket. You need to use a \verb+\mbox+.

\begin{exe}
\ex
\begin{verbatim}
\phonc{t}{ts}{
\oneof{
\phold \mbox{i} \\
\phold \mbox{u}}
}
\end{verbatim}
\ex \phonc{t}{ts}{
\oneof{
\phold \mbox{i} \\
\phold \mbox{u}}}
\end{exe}

The \verb+\phonfeat+ command allows you to insert feature specifications:

\begin{exe}
\ex
\begin{verbatim}
\phonc{t}{ts}{\phold 
\phonfeat{
\mbox{–consonantal} \\
\mbox{+high} \\
\mbox{+front}}
}
\end{verbatim}
\ex \phonc{t}{ts}{\phold 
\phonfeat{
\mbox{– consonantal} \\
\mbox{+high} \\
\mbox{+front}}}
\end{exe}

\verb+\phold+ typesets a place holder line. You can nest \verb|oneof| and \verb|phonfeat| commands for complex rules.

\begin{exe}
\ex
\begin{verbatim}
\phonc{x}{y}{\oneof{
	\phold \mbox{z} \\
	\phonfeat{
	+\mbox{feature x} \\
	-\mbox{feature y}} \phold}}
\end{verbatim}
\ex \phonc{x}{y}{\oneof{
	\ \phold \mbox{z} \\ \\
	\phonfeat{
	\mbox{+feature x} \\
	\mbox{-feature y}} \phold}}
\end{exe}

You can use \verb|\env|, \verb|\envl|, \verb|\envr|, \verb|\envb| for rules with more than one output: these command typeset only the different outputs with their respective environments.

\begin{exe}
\ex
\begin{verbatim}
\phon{x}{\oneof{
	\envr{w}{\mbox{z}} \\
	\envl{v}{\phonfeat{
	+\mbox{feature x} \\
	-\mbox{feature y}}}}}
\end{verbatim}
\ex \phon{x}{\oneof{
	\envr{\mbox{w}}{\mbox{z}} \\
	\envl{\mbox{v}}{\phonfeat{
	+\mbox{feature x} \\
	-\mbox{feature y}}}}}
\end{exe}

\section{Changelog}
\subsection{v1.0.0}
\begin{itemize}
\item new definition of commands with \verb|\ensuremath|
\item change of environments to commands
\item definition of new commands \verb|\env| for personalized outputs
\item updated place holder to 1.5ex length, -1.5pt vertical position
\item updated curly brackets to only left in \verb|\oneof| command
\end{itemize}

\end{document}