[XeTeX] xunicode's textipa command

Andy Lin kiryen at gmail.com
Mon Nov 9 07:25:02 CET 2009


Hi Ross,

On Sun, Nov 8, 2009 at 22:42, Ross Moore <ross at ics.mq.edu.au> wrote:
> Hi Andy,
>
> On 09/11/2009, at 12:03 PM, Andy Lin wrote:
>
>> On Sun, Nov 8, 2009 at 13:55, Ross Moore <ross at ics.mq.edu.au> wrote:
>>>
>>> However, with the modern eTeX extensions to TeX, you can overcome
>>> this kind of difficulty:
>>>
>>>  \newcommand\ipa[1]{\textipa{\scantokens{#1}}}
>>
>> Ah, I had no idea that was how \ex. operated. I thought it merely set
>> \par to be active to serve as an end-environment.
>
> No, not that simple --- well, that would be friendlier,
> but is harder to program actually.
>
Ah, just goes to show how much I still have to learn.

>
>>>>>> 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
>
> BTW, you got these the wrong way round:
>
> Define SC U+003A ;;  << SEMICOLON
> Define CO U+003B ;:  << COLON
>
Oops, yes, I'll correct that.
>
>>>> 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.
>
> OK. I think these were ones I was unsure of, when preparing
> this part of xunicode.sty .
> I asked for people to check it, but got no response.
> Though I recall there being some discussion about different g's
> or was it gamma's, some time back.
>
While I was researching the problem I found a message that mentioned
baby gamma and rams horns being given the same unicode codepoint in
xunicode, but I don't think that's the case, at least, not with my
version of the sty file.

>
>>>
>>> Please explain this in detail, with examples.
>>> Aaaah, you file  xetex-tipa.map  does this.
>
>
> With your example (extended slightly), I now get:
>
>
> (1) = ascii characters
> (2) = XeTeX + xunicode
> (3) =  +tecKit map
>
> The font is Charis SIL.
> My Cambria doesn't have all the glyphs.
>
That looks perfect!

I have Cambria version 5.93, which comes with the Windows 7 release
candidate. I think they've added additional glyphs since the Vista
version (5.00) or the one that comes with Office. I was rather
surprised, even with the 5.00 version, how many IPA symbols it had,
but obviously, it (still) doesn't have the coverage of Charis SIL.

>
>>>
>>> Would it be sufficient to make the expansion of ; (active)
>>> to check the next token and produce the appropriate
>>> characters for ;B  ;G  ;U  ;Z  ;"  else \texthalflength  ?
>>>
>>> If this is all that is needed, I'll adjust the  xunicode.sty
>>> coding to implement this.
>>>
>
>> I actually took the lines ( e.g. ;B > U+03B2;\textbeta...) straight
>> from the xunicode.sty file, including some lines that were commented
>> out with % in the sty file (which I've commented out with ; in the map
>> file),
>
> OK; I wasn't sure that ';' was always a comment symbol.
>
>> the only modifications I've made are to G and U (the tipa
>> manual shows these as tall as the x-height); B, Z, and ; have the same
>> alternate definitions within xunicode.sty.
>>>>
>>>> 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.
>>>
>>> Send a real-world example (with a PDF of what the output
>>> should look like) so I can be sure I'm doing the right thing.
>>
>> I've attached a tex and pdf file.
>
> With some small changes in xunicode, I now get consistency
> (apart from those semi-/colons).   See the attached image.
>
> Are there any other letters that need testing?
>
I don't believe so. At least not wrt textipa. There are issues with
using tipa commands in XeTeX that I've encountered myself, but they're
beyond the scope of xunicode -- \textbottomtiebar for example, which
has to be placed (in the case of fonts like Arial Unicode MS) and/or
resized by a command because it spans 2 glyphs. I'll try a "tipa
sample sheet" tomorrow or Tuesday (I have a couple of assignments due
tomorrow) and I'll report back with my findings.

>
>>>>>> Has anyone run into this problem before? Can it be solved by some
>>>>>> combination of \protect, \expandafter, etc.?
>>>
>>>  The primitive you want to use is  \scantokens .
>>>  This allows the \catcode to be altered for otherwise frozen
>>>  characters.
>
> Also, the  \scantokens  can be written-in to xunicode's
> definition of  \textipa .
> I'm pretty sure that it is safe to do this.
>
Sounds great! I'll try out \textipa with \scantokens in a couple more
situations/environments and I'll let you know if I run into any
problems.

Thanks for all your help!

Sincerely,
Andy Lin

>
>>>> Sincerely,
>>>> Andy Lin
>
>
> Cheers,
>
>        Ross
>
> ------------------------------------------------------------------------
> 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
> ------------------------------------------------------------------------
>
>
>
>
>


More information about the XeTeX mailing list