[XeTeX] xunicode's textipa command

Ross Moore ross at ics.mq.edu.au
Mon Nov 9 04:42:56 CET 2009


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.


>>>>> 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


>>> 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.


>>
>> Please explain this in detail, with examples.
>> Aaaah, you file  xetex-tipa.map  does this.


With your example (extended slightly), I now get:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: texshop_image.jpeg
Type: image/jpeg
Size: 60328 bytes
Desc: not available
URL: <http://tug.org/pipermail/xetex/attachments/20091109/d83435b4/attachment-0001.jpeg>
-------------- next part --------------

(1) = ascii characters
(2) = XeTeX + xunicode
(3) =  +tecKit map

The font is Charis SIL.
My Cambria doesn't have all the glyphs.


>>
>> 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?


>>>>> 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.


>>> 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