[XeTeX] xunicode.sty -- pinyin and TIPA shortcuts
Ross Moore
ross at ics.mq.edu.au
Sun Apr 9 03:47:15 CEST 2006
Hi Robert,
On 08/04/2006, at 12:15 PM, Robert Spence wrote:
> Hi Ross,
>
> I just figured out a simple solution for the phonetic g glyph that
> you might perhaps like to think about for the next version of
> xunicode.sty:
>
> Simply change line 752 to read:
>
> \DeclareUTFcharacter[\UTFencname]{x0261}{\textg}
>
> (instead of x0067 as at present; and definitely _not_ the code-
> point I erroneously suggested in my last posting...)
>
> This would mean that if xunicode.sty was loaded you could directly
> access the correct phonetic glyph (LATIN SMALL LETTER SCRIPT G) at
> any point in a document by typing the \textg command.
Since xunicode.sty already has:
\DeclareUTFcharacter[\UTFencname]{x0261}{\textscriptg}
then all that is needed is: \let\textg\textscriptg
which can be done easily in a document preamble.
Since tipa.sty has both:
\DeclareTextSymbolDefault\textscriptg{T3}
\DeclareTextSymbolDefault\textg{T3} % Text G
are you saying that they both actually represent the same concept,
so are just variant print-forms ?
> And if you were inside the argument of a \textipa{...} command
> you'd have a choice: if you knew your font had a glyph of the right
> shape at x0067 you could just type g, otherwise you could type
> \textg as you'd be confident that you had a font containing all the
> glyphs for the phonetic characters up in that Unicode code-point
> range.
Ouch. This is mixing visual markup in with logical markup.
I know it has a practicality, but for electronic documents
it's a possible source of confusion.
>
> This would still involve a slight change in keyboarding behaviour
> for us legacy people compared with Fukui Rei's tipa.sty package,
> where the meaning of \textg was "flip to the _other_ glyph shape
> than the one you should be getting in this environment". But I
> doubt it would be worth trying to fully emulate legacy keyboarding
> styles here in any case, because to do so you'd have to change the
> \catcode of g to active within the argument of a \textipa{...}
> command---but if you did that, TeX couldn't interpret what \gdef
> meant at line 673 of xunicode.sty:
Hmm. No, I don't think it's a good idea to do that.
It's better, long-term, for people to move away from keyboarding styles
that rely on visual information rather than logical information.
>
> 672 \setTIPAcatcodes
> 673 \gdef
>
> because it wouldn't get past the g in \gdef (!)
>
> No doubt there's a dangerous double bend section somewhere in the
> Dirty Tricks chapter of the TeXbook that would help... but it's
> certainly a bit beyond anything _I'd_ dare play around with in
> TeX. (Maybe you or Will or Jonathan might be more daring,
> though... ;-)
I'm sure I could devise a way around this, if necessary.
But I don't see the necessity, in this case -- at least
not for xunicode.sty itself.
Certainly if could go into a specialised add-on package,
when a particular author really needed it, or to cope with
a large number of legacy documents.
>
> Thanks for the thorough description of the encoding issue. I had
> so many problems with encodings when I first started playing with
> XeTeX that I decided to try to get by without them altogether, or
> at least only use them locally in isolated font calls. It's not so
> much bits of "old" material I want to include in new "mixed"-style
> documents, it's more just a question of wanting not to have to
> retrain my fingers and brain for too many new keyboard layouts all
> at once. I find it really does help to have all those active
> uppercase letters you defined in xunicode.sty, and I'm grateful for
> them.
Good.
I'm glad someone finds these things useful.
Personally I have no specific use, so would not even
be able to tell whether it was all done correctly.
>
> Cheers,
> -- Rob Spence
Cheers,
Ross
------------------------------------------------------------------------
Ross Moore ross at maths.mq.edu.au
Mathematics Department office: E7A-419
Macquarie University tel: +61 +2 9850 8955
Sydney, Australia 2109 fax: +61 +2 9850 8114
------------------------------------------------------------------------
More information about the XeTeX
mailing list