8

The following is a phonological rule, taken from this Wikipedia page:

enter image description here

Is there a package or some other convenient way to format this in LaTeX?

Danger Fourpence
  • 2,039
  • 1
  • 15
  • 39
  • I know this is a LaTeX related question, so please see the meta:http://meta.linguistics.stackexchange.com/questions/489/should-we-have-a-tag-for-latex – Danger Fourpence Apr 08 '13 at 13:58

4 Answers4

9

EDIT: since I've updated the package, \mbox is not necessary and I removed it from the example below.

I developed a package for typesetting phonological rules: phonrule.

An example:

\phon{x}{\oneof{
\envr{w}{z} \\
\envl{v}{\phonfeat{
+feature x \\
-feature y}}}}

Phonological rule example.

The code to achieve the rule of the question:

\phonb{\phonfeat{+stop \\ +consonant \\ +alveolar}
}{[ɾ]}{\phonfeat{+vowel \\ +stressed}}{\phonfeat{+vowel \\ +stressed}}

with its output.

Tapping of coronals in AE.

Stefano
  • 323
  • 2
  • 6
  • 1
    I uploaded an update in CTAN, it will take a while for the new version to spread. In this version the \mbox is not necessary anymore, simplifying things a bit. I'll update the answer asap. – Stefano Jul 04 '15 at 12:05
  • 1
    It has long puzzled me why there wasn't a package on ctan that would do this for you. Now finally there is! – Sverre Jul 14 '15 at 21:36
4

These kinds of phonological rules are pretty easy to do with standard LaTeX such as mbox, the array environment, etc. Here's an example (warning to TeXperts, you may find this ugly!):

\begin{figure}[h]  \centering %#%\small
  \[ \mbox{/h/ $\rightarrow$} \left\{
    \begin{array}{l}
      \parbox{1.7in}{[h] $\sim$ [\slashed{0}]{\Large /}     \underline{~~~~}C_{\textsubscript{\textsc{son}}}}  \\
      \parbox{1in}{[\texthth]  {\Large /} V\underline{~~~~}V} \\
      \mbox{[h] ~ elsewhere}
    \end{array}
  \right.
  \]
  \caption{Allophonic variation of /h/}
\end{figure}

This gives:

Allophonic variation of /h/

I'm not sure what other phonological rules you're interested in displaying in LaTeX, but I can provide an example Optimality Theory tableau if that's helpful.

There's some useful information at the LaTeX for linguists page. That page is getting a bit outdated now but a general web search (eg 'latex linguistics phonology') will find lots more examples.

Gaston Ümlaut
  • 6,697
  • 30
  • 46
3

A late answer but perhaps it will help someone. Here's some code to generate a rule very similar to that of the example.

\documentclass[11pt]{article}
\usepackage{amsmath,amsthm,amssymb}

\usepackage{tipa}
\usepackage{soul}

\begin{document}


\begin{math}
\left[
\begin{array}{l}
+\mbox{stop} \\
+\mbox{consonant} \\
+\mbox{alveolar}
\end{array}
\right]
\longrightarrow 
\end{math} % Ending math mode to use the IPA symbol below 
[\textfishhookr] % Using `tipa' package in the preamble
\begin{math} % Resume math mode
\left. \middle/ 
\left[
\begin{array}{l}
+\mbox{vowel} \\
+\mbox{stressed}
\end{array}
\right]
\right.
\end{math} % Ending math mode to have a good underscore below (using package `soul')
\setul{.5cm}{.4pt}% Lower the space between the underline and the text
\ul{$\qquad$} 
\begin{math}
\left[
\begin{array}{l}
+\mbox{vowel} \\
-\mbox{stressed}
\end{array}
\right]
\end{math}


\end{document}

And it should look like this:

enter image description here

edominic
  • 846
  • 7
  • 9
1

You could make the above rule as follows:

\documentclass{article}\usepackage{tipa,amsmath}
\begin{document}
    $\left[\begin{array}{l}+\text{stop}\\+\text{consonant}\\+\text{alveolar}\end{array}\right] \longrightarrow$ \textipa{[R]} /
        $\left[\begin{array}{l}+\text{vowel}\\+\text{stressed}\end{array}\right]$ \rule[-10pt]{20pt}{1pt} $\left[\begin{array}{l}+\text{vowel}\\-\text{stressed}\end{array}\right]$
\end{document}

Generally, you could define a macro to automate some of the typing. A crude and simple one puts the following commands in the preamble:

\newcommand{\fSet}[2]{#1\text{#2}\\}
\newcommand{\featMatrix}[1]{$\left[\begin{array}{l}#1\end{array}\right]$}
\def\goesTo{$\longrightarrow$}
\def\Context{\rule[-10pt]{20pt}{1pt}}

Then you can produce the same rule more simply as:

\featMatrix{\fSet{+}{stop}\fSet{+}{consonant}\fSet{+}{alveolar}}
\goesTo
\textipa{[R]}
/
\featMatrix{\fSet{+}{vowel}\fSet{+}{stressed}}
\Context\
\featMatrix{\fSet{+}{vowel}\fSet{-}{stressed}}