# TIPA: suppress tonestembar no longer works in fontspec

Most of the features in tipa from TeXLive2009 seem to be part of fontspec in TeXLive2012 -- if you activate both, you get an error message: "Command sups already defined".

The following code to suppress the side tonestembars on tone letters worked fine with tipa in TeXLive2009, but no longer works with fontspec in TeXLive2012:

\makeatletter
\renewcommand\@tonestembar{%
\setbox0\hbox{\tipaencoding\char'277}%
\hbox{\vrule height \ht0 depth \dp0
width 0pt}}
\makeatother


You get an error that tonestembar is undefined, and the tonemarks are printed with the sidebar attached.

Is there any way of tweaking this code to persuade TeXLive2012 to suppress the tonestembars?

MWE latex (works):

\documentclass[a4paper,12pt, oneside]{article}

\usepackage[T1]{fontenc}
\usepackage[utf8x]{inputenc}
\usepackage{mathptmx}

\usepackage[tone]{tipa}  %  tone invokes the tone letters
% Fix tonemarks to show marks without sidebars.
\makeatletter
\renewcommand\@tonestembar{%
\setbox0\hbox{\tipaencoding\char'277}%
\hbox{\vrule height \ht0 depth \dp0 width 0pt}} % no stem
\makeatother

\begin{document}

This is an example of the tonemarks without the stembars:

\textbf{babubibuba [~\tone{11}\, \tone{55}\, \tone{33}\, \tone{55}\, \tone{11}~]}

\end{document}


MWE xetex (doesn't work):

\documentclass[a4paper,12pt, oneside]{article}

\usepackage{fontspec}
\defaultfontfeatures{Mapping=tex-text, Scale=MatchLowercase}
\setmainfont{Charis SIL}

% \usepackage[tone]{tipa}  % IPA letters - tone invokes the tone letters
% Fix tonemarks to show marks without sidebars.
\makeatletter
\renewcommand\@tonestembar{%
\setbox0\hbox{\tipaencoding\char'277}%
\hbox{\vrule height \ht0 depth \dp0 width 0pt}} % no stem
\makeatother

\begin{document}
\fontspec[Renderer=Graphite]{Charis SIL}

This is an example of the tonemarks which are showing the stembars in spite of using the suppression code that works in latex:

\textbf{babubibuba [~\tone{11}\, \tone{55}\, \tone{33}\, \tone{55}\, \tone{11}~]}


\end{document}

-
– Claudio Fiandrino Mar 9 '13 at 13:21
Since this code isn't documented in the TIPA manual it would be helpful to post a minimal document that shows what it does with pdflatex so that we can see the effect that needs to be implemented in with the xunicode version (the work is done by the xunicode package, not actually by fontspec.) – Alan Munn Mar 9 '13 at 13:46
It would also be helpful to show a XeTeX document which uses the tones (with the tonestembars). – Alan Munn Mar 9 '13 at 14:42
Sorry, MWEs now added. – donnek Mar 9 '13 at 15:38
Thanks for the examples. Because the tone characters are now implemented as real Unicode combining characters, the bar is an integral part of the glyph, and Unicode doesn't seem to have included ones without the bar (since they are not IPA). So to do this you'll need some sort of a hack, as far as I can tell. – Alan Munn Mar 9 '13 at 17:35

The support for tipa input provided by fontspec comes from the xunicode package. However, it does not cover everything that tipa can do. A work-around is to prevent xuicode loading:

\documentclass[a4paper,12pt, oneside]{article}
\expandafter\def\csname ver@xunicode.sty\endcsname{}
\usepackage[tone]{tipa}  %  tone invokes the tone letters
\usepackage{fontspec}
\defaultfontfeatures{Mapping=tex-text, Scale=MatchLowercase}
\setmainfont{Charis SIL}

% \usepackage[tone]{tipa}  % IPA letters - tone invokes the tone letters
% Fix tonemarks to show marks without sidebars.
\makeatletter
\renewcommand\@tonestembar{%
\setbox0\hbox{\tipaencoding\char'277}%
\hbox{\vrule height \ht0 depth \dp0 width 0pt}} % no stem
\makeatother

\begin{document}
\fontspec[Renderer=Graphite]{Charis SIL}

This is an example of the tonemarks which are showing the stembars in spite of using the suppression code that works in latex:

\textbf{babubibuba [~\tone{11}\, \tone{55}\, \tone{33}\, \tone{55}\, \tone{11}~]}


\end{document}


although of course if the real document uses other xuincode features this will be an issue!

-