I'm trying to use the tipa package with fontspec, but they don't play nice together. I've read previous questions trying to solve the issues that come up (like this one), and that's the solution I've been using so far.
However, I've bumped into a problem that I can't really understand. Below I include a (unrealistically brief) MWE taken from the question linked to above. The real document is much more complex, but this illustrates the problem nicely. The following document compiles with no warnings or errors for me:
\documentclass{article}
\usepackage{tipa}
\usepackage{fontspec}
\AtBeginDocument{
\renewcommand\textipa[2][r]{{\fontfamily{cm#1}\tipaencoding #2}}
}
\renewenvironment{IPA}[1][r]
{\fontfamily{cm#1}\tipaencoding}
{}
\begin{document}
\textipa{f@"nEtIks}
\end{document}
But adding a line like
\textipa{\~an\~a}
breaks it. What is really puzzling is that compilation halts without any sort of warning, even with -interaction=nonstopmode enabled. In the above example I could simply use \~an\~a, without the tipa environment, but in other cases this is not an option.
I've read the recommendations for linguistics papers, but since all my transcriptions are already typed out using tipa, I'm reluctant to give it up and start doing the charmap spelunking that would be necessary.
Is there a way to use \~ in a tipa environment while still using fontspec?
fontspecline and it will work. – yannisl Feb 26 '13 at 20:58\~, but that's the whole point: I needfontspecjust as much as I need\~. I find it hard to believe that it is not possible to use both. – jja Feb 26 '13 at 21:12\tracingallshows that\~gets itself into an infinite loop expanding to a definition that includes itself. Not entirely sure why yet – David Carlisle Feb 26 '13 at 21:26{\fontencoding{OT1}\selectfont\~ a}works although it's a bit less than ideal. – David Carlisle Feb 26 '13 at 21:27tipaenvironment, does it? Because something like\textipa{{\fontencoding{OT1}\selectfont\~ O}na}does not print a nasalised ɔ but an O with a tilde on top. – jja Feb 27 '13 at 12:32