[XeTeX] xunicode's textipa command

Andy Lin kiryen at gmail.com
Sun Nov 8 05:02:34 CET 2009


Hi Ross,

On Sat, Nov 7, 2009 at 00:14, Ross Moore <ross at ics.mq.edu.au> wrote:
> Hello Andy,
>
> On 07/11/2009, at 4:17 AM, Andy Lin wrote:
>
>> I'm currently using linguex to typeset examples, and I've noticed that
>> \textipa is broken within the \ex. command/environment. Upon further
>> investigation, it seems that even \newcommand\ipa[1]{\textipa{#1}}
>> breaks \textipa (although \let\ipa\textipa, as mentioned in the tipa
>> manual, is fine). I'm not sure what the problem is exactly, if it has
>> to do with xunicode setting capital letters as active in its textipa
>> implementation or something else,
>
> No. xunicode  redefines most of the TIPA-defined macros to result in
> the correct Unicode codepoints, so that most things just work,
> provided
>
>  1. you set a font that has the correct glyphs;
>    e.g. Charis SIL
>
>  2. you do *not* load  tipa.sty  which would just
>    create confusion (unless you know how to keep
>    the definitions well-separated, using the
>    font-encoding mechanism).
>
> The advantage of using  XeTeX + xunicode  is that the
> resulting PDF should be searchable, even for non-Latin
> characters, and copy/paste should work from the PDF
> into text-based documents.
> LaTeX + TIPA package does not give you these practical
> benefits.
>
The tipa text commands that are redefined in xunicode (e.g.
\textturna) work great, but it's the \textipa command which is a
little bit problematic, since xunicode's implementation of it involves
turning A-Z, 0-9, and ;:| and @ into active characters. It works fine
in standard paragraph mode, but it seems to break inside certain
environments and doesn't seem to allow its inclusion in \newcommands.

>
>> but I did find an earlier discussion
>> on the subject
>> http://groups.google.com/group/comp.text.tex/browse_thread/thread/64916c5485349818/f8fdde95b0a636ba?#f8fdde95b0a636ba
>> though the solution proposed there was to simply input the unicode
>> equivalents of the IPA characters (which would break compatibility
>> with non-unicode LaTeX), or to come up with a TECkit mapping for the
>> IPA characters (which I'm willing to do, but only if there are no
>> other options).
>
> The TECkit mapping approach is interesting, but is really only
> applicable if you are using non-active characters, rather than
> macros, to specify the font characters.
>
I ended up making a TECkit mapping soon after I posted the message
when I realized that the \textipa command was only responsible for
remapping 40 glyphs. I've attached the map and tec files. I've changed
the glyph mapping for G and U, these are lowercase glyphs in tipa but
xunicode maps them to uppercase.

To use it, add the following to your preamble
\AtBeginDocument{\def\textipa#1{{\addfontfeatures{Mapping=xetex-textipa}#1}}}

I was reluctant to use this solution because it's an additional file
that people have to install in order to have linguex, tipa, and XeTeX
play together nicely. (I'm running a LaTeX tutorial in a couple of
weeks with people who are used to Word, and the less I ask them to dig
around their texmf trees the better.) However, the \textipa command
was written to map normal, non-active, basic latin characters to IPA
glyphs so it seems that a TECkit mapping is the appropriate solution
here.

>> Has anyone run into this problem before? Can it be solved by some
>> combination of \protect, \expandafter, etc.?
>>
>
> Can you provide an example (La)TeX document that displays
> some of the difficulties that you are facing.
>
\documentclass{article}
\usepackage{xltxtra}
\setmainfont{Cambria}
\usepackage{linguex}
%\AtBeginDocument{\def\textipa#1{{\addfontfeatures{Mapping=xetex-textipa}#1}}}
%This is the solution that I'm using now, having made the xetex-textipa map
\begin{document}
\textipa{ABCabc} % This text renders as it should (script a, s-z,
curly tail c, abc)

\ex. \textipa{ABCabc} % This text renders as ABCabc

\end{document}
>
>> Sincerely,
>> Andy Lin
>
>
> Hope this helps,
>
>        Ross
>
>
> Oh, by the way, please subscribe to the XeTeX list,
> if you want to continue this kind of email exchange.
Thanks for the suggestion, I've done so!

Sincerely,
Andy Lin

> ------------------------------------------------------------------------
> Ross Moore                                       ross at maths.mq.edu.au
> Mathematics Department                           office: E7A-419
> Macquarie University                             tel: +61 (0)2 9850 8955
> Sydney, Australia  2109                          fax: +61 (0)2 9850 8114
> ------------------------------------------------------------------------
>
>
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xetex-textipa.tec
Type: application/octet-stream
Size: 305 bytes
Desc: not available
URL: <http://tug.org/pipermail/xetex/attachments/20091107/84cbc8f0/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xetex-textipa.map
Type: application/octet-stream
Size: 2146 bytes
Desc: not available
URL: <http://tug.org/pipermail/xetex/attachments/20091107/84cbc8f0/attachment-0003.obj>


More information about the XeTeX mailing list