Will Styler's Homepage
Will Styler

Associate Teaching Professor of Linguistics at UC San Diego

Director of UCSD's Computational Social Science Program

Converting Unicode IPA to TIPA for LaTeX documents, easily

This was originally posted on my blog, Notes from a Linguistic Mystic in 2012. See all posts

EDIT: Although this method works fine, as several commenters have pointed out, you’re better off using XeLaTeX and a regular Unicode IPA keyboard and font. It’s easier, looks nicer in preview, and is much less painful than TIPA.

This is very esoteric, but I absolutely have to share this. So, the majority of people use Unicode IPA fonts and IPA entry to put IPA in documents, and that’s absolutely fine. However, those of us who often write homeworks, tests, or papers in LaTeX can’t do that, as LaTeX doesn’t natively support unicode IPA.

The solution, of course, is to use TIPA, which is an excellent system for typesetting IPA symbols (and in fact, the only reliable way I’ve found to ensure that diacritics are placed in the right places). Unfortunately, actually typing in TIPA is a terrible endeavor, as many of the symbols are represented with several characters, or with longer escape sequences (“Columbia” is [k@” l\textturnv mbi@] in TIPA), and although it makes sense at some level, it’s far from intuitive.

So, fed up with manually looking up TIPA symbols, I stumbled upon the magnificently wonderful E-linguistics Toolkit, and from that, have a solution which makes using TIPA tolerable, a simple terminal command which, when run, converts text from unicode IPA into TIPA markup, allowing me to type quickly and still use my IPA in LaTeX.

Here’s how to set it up on your Mac (or linux box), assuming you’ve got a bit of command-line knowledge:

  1. Download and install the eltk from their website. You’ll download the zip file, then follow the directions in the readme.

  2. Download this file, my tipafy script. I’ll assume it’s on your desktop

  3. Run these two commands in your terminal:

    • sudo cp ~/Desktop/tipafy.py /usr/bin/tipafy.py
    • sudo chmod +x /usr/bin/tipafy

Or you could just run it directly with python.

Then, you’re done! (Sorry, Windows people, I don’t really know how python and creating/running executables works for you :()

Now, let’s say you’ve got a chunk of unicode IPA, like “fownɛˈtɪʃn”, and you need it in TIPA form. Just open a terminal window and type the below:

tipafy fownɛˈtɪʃn

… and it’ll output:

\textipa{fownE" tISn}

Which is ready to be dropped into a LaTeX document.

If you have multiple words, just put the whole thing in quotes:

tipafy "ðə 'sowldʒə˞ də'sajdɪd"

… and it’ll output everything as a TIPA command.

It’s not perfect, but it gets you a heck of a lot closer than just typing blindly, and in my experience, it’s been faster to type unicode and convert than to actually try and remember the TIPA commands for everything. And, of course, the real credit goes to Scott Farrar and the eltk people, who made it possible for this whole thing to work.