<div>Many thanks for discussions on my issue! </div><div></div><div>Now I understand that XeTeX is intended to regard Chinese chars as normal "letters". Is it possible to simply define a macro to let non-alpha chars terminate the command parsing? Note that LaTeX provides commands \makeatother and \makeatletter to do somewhat similar work:-) Especially, I hope to extend such features for "@" to chinese characters (including chinese punctuations) since it would look more natural not to insert odd spaces or "\ " for Chinese typesetting.<br>
</div><br><div class="gmail_quote">2009/10/17 <span dir="ltr"><<a href="mailto:xetex-request@tug.org">xetex-request@tug.org</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Send XeTeX mailing list submissions to<br>
<a href="mailto:xetex@tug.org">xetex@tug.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
<a href="http://tug.org/mailman/listinfo/xetex" target="_blank">http://tug.org/mailman/listinfo/xetex</a><br>
or, via email, send a message with subject or body 'help' to<br>
<a href="mailto:xetex-request@tug.org">xetex-request@tug.org</a><br>
<br>
You can reach the person managing the list at<br>
<a href="mailto:xetex-owner@tug.org">xetex-owner@tug.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of XeTeX digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
1. Re: wrong alignment with optical bounds (Pablo Rodr?guez)<br>
2. getting \newXeTeXintercharclass to work (Michiel Kamermans)<br>
3. How to prevent Chinese chars to be treated as part of TeX<br>
command? (mhbezine209 mhbezine2009)<br>
4. Re: How to prevent Chinese chars to be treated as part of TeX<br>
command? (Akira Kakuto)<br>
5. Re: How to prevent Chinese chars to be treated as part of TeX<br>
command? (Joseph Wright)<br>
6. Re: How to prevent Chinese chars to be treated as part of TeX<br>
command? (Michiel Kamermans)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Fri, 16 Oct 2009 22:01:28 +0200<br>
From: Pablo Rodr?guez <<a href="mailto:oinos@web.de">oinos@web.de</a>><br>
To: Unicode-based TeX for Mac OS X and other platforms <<a href="mailto:xetex@tug.org">xetex@tug.org</a>><br>
Subject: Re: [XeTeX] wrong alignment with optical bounds<br>
Message-ID: <<a href="mailto:4AD8D118.10400@web.de">4AD8D118.10400@web.de</a>><br>
Content-Type: text/plain; charset=UTF-8<br>
<br>
Jonathan Kew wrote:<br>
> On 10 Oct 2009, at 18:45, Pablo Rodr?guez wrote:<br>
><br>
>> Hi Jonathan and others,<br>
>><br>
>> I have just tried the following code:<br>
>><br>
>> \documentclass[12pt]{article}<br>
>> \usepackage[a5paper]{geometry}<br>
>> \usepackage{fontspec}<br>
>> \fontspec[RawFeature=+opbd;-liga]{Grandjean Baskerville}<br>
>> \begin{verse}<br>
>> ???????? ???\\<br>
>> ??? ???? ?? ??????\\<br>
>> ????? ????\\<br>
>> ??? ????????.<br>
>> \end{verse}<br>
>> \end{document}<br>
>><br>
>> And the result can be located at <a href="http://www.ousia.tk/a.pdf" target="_blank">http://www.ousia.tk/a.pdf</a>. XeTeX is<br>
>> applying the optical bound to the first letter in text, but it also<br>
>> creates a kind of positive kerning with the next letter.<br>
>><br>
>> I guess this might be a bug.<br>
><br>
> I'm afraid you're trying to do something that simply isn't supported.<br>
> The OpenType features for optical bounds require the application to<br>
> apply different lookups depending on where the glyph occurs on the line,<br>
> but xetex does not support this; it applies the features you specify to<br>
> the entire run of text, *before* line-breaking decisions have been made,<br>
> so it cannot apply them contextually depending whether the glyph is<br>
> actually at the start of line in the finished paragraph.<br>
<br>
Thanks for your reply, Jonathan. Sorry for not having answered before.<br>
<br>
> The spacing after the initial ? in your PDF does look odd; this may have<br>
> something to do with the type of OpenType lookup that has been used in<br>
> that font. This may well be a bug. However, regardless of that, I don't<br>
> think you can usefully use OT features in this way at the moment.<br>
> Consider what would happen if a word beginning with ? occurred in the<br>
> middle of a line: it would end up intruding into the preceding<br>
> inter-word space, because the feature is being applied indiscriminately.<br>
<br>
First of all, I'm not 100% sure that the bug in the odd space is not<br>
caused by the font, since I don't know whether the opbd feature was<br>
properly applied using FontForge.<br>
<br>
But consider the following example when typesetting poetry. If there<br>
were not odd space when applying opbd, there would be a possibility of<br>
tagging the first word in verse beginning with ? using the command<br>
\fontspec[RawFeature=+opbd;-liga]{Grandjean Baskerville} and so avoiding<br>
other word in the middle of a verse with hanging diacritics.<br>
<br>
Thanks for your help,<br>
<br>
<br>
Pablo<br>
<br>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Fri, 16 Oct 2009 14:16:18 -0700<br>
From: Michiel Kamermans <<a href="mailto:pomax@nihongoresources.com">pomax@nihongoresources.com</a>><br>
To: XeTeX Mailing List <<a href="mailto:xetex@tug.org">xetex@tug.org</a>><br>
Subject: [XeTeX] getting \newXeTeXintercharclass to work<br>
Message-ID: <<a href="mailto:4AD8E2A2.9040107@nihongoresources.com">4AD8E2A2.9040107@nihongoresources.com</a>><br>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed<br>
<br>
Hi,<br>
<br>
I'm trying to get the \newXeTeXintercharclass functionality to work, but<br>
using the idea from Enrico Gregorio from his mail to the list on<br>
5/28/2009 to add some code to xelatex.ini does not seem to do a great<br>
deal; xelatex still throws an error when it encounters<br>
\newXeTeXintercharclass, claiming it is an undefined control sequence.<br>
<br>
Has anyone tried to retrofit Enrico's suggestion using XeTeX<br>
3.1415926-2.2-0.999.7? If so, with success? (if so, what did you do? =P)<br>
<br>
- Mike "Pomax" Kamermans<br>
<a href="http://nihongoresources.com" target="_blank">nihongoresources.com</a><br>
<br>
<br>
------------------------------<br>
<br>
Message: 3<br>
Date: Sat, 17 Oct 2009 11:34:24 +0800<br>
From: mhbezine209 mhbezine2009 <<a href="mailto:mhbezine2009@gmail.com">mhbezine2009@gmail.com</a>><br>
To: <a href="mailto:xetex@tug.org">xetex@tug.org</a><br>
Subject: [XeTeX] How to prevent Chinese chars to be treated as part of<br>
TeX command?<br>
Message-ID:<br>
<<a href="mailto:8004fc3c0910162034u47afb0b9p2a6e55146c30ba46@mail.gmail.com">8004fc3c0910162034u47afb0b9p2a6e55146c30ba46@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="gb2312"<br>
<br>
I find a problem of XeTeX: I often encounter errors like<br>
"! Undefined control sequence l.6 \TeX???"<br>
when I typeset Chinese documents with XeTeX.<br>
See example below to have an idea on the source of errors.<br>
------cut from here----------<br>
\documentclass{article}<br>
\usepackage{xeCJK}<br>
\begin{document}<br>
\TeX??Hello<br>
\end{document}<br>
-------end----------------------<br>
<br>
Such errors occur when chinese characters (or any other non-ASCII unicode<br>
chars) follow a valid command immediately.<br>
In other words, if there is no space between Chinese characters and a<br>
command name,<br>
XeTeX will treat the Chinese characters as part of the command name, so it<br>
issues an error message. I do not know whether it is a bug of XeTeX or it<br>
is intended. Anyway, I find this design is very annoying because I must<br>
manually add a white space or {} after each command name so as to avoid such<br>
errors. Does anybody to have good solution to resolve this problem? It would<br>
be disirable if this feature of XeTeX can be disabled with one command or a<br>
macro. I think it would be better to restrict command names in ASCII chars.<br>
Thanks for any discussion on this issue:-)<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://tug.org/pipermail/xetex/attachments/20091017/8cd797ba/attachment-0001.html" target="_blank">http://tug.org/pipermail/xetex/attachments/20091017/8cd797ba/attachment-0001.html</a>><br>
-------------- next part --------------<br>
A non-text attachment was scrubbed...<br>
Name: aaa.tex<br>
Type: application/x-tex<br>
Size: 99 bytes<br>
Desc: not available<br>
URL: <<a href="http://tug.org/pipermail/xetex/attachments/20091017/8cd797ba/attachment-0001.tex" target="_blank">http://tug.org/pipermail/xetex/attachments/20091017/8cd797ba/attachment-0001.tex</a>><br>
<br>
------------------------------<br>
<br>
Message: 4<br>
Date: Sat, 17 Oct 2009 14:25:30 +0900<br>
From: "Akira Kakuto" <<a href="mailto:kakuto@fuk.kindai.ac.jp">kakuto@fuk.kindai.ac.jp</a>><br>
To: Unicode-based TeX for Mac OS X and other platforms <<a href="mailto:xetex@tug.org">xetex@tug.org</a>><br>
Cc: <a href="mailto:xetex@tug.org">xetex@tug.org</a><br>
Subject: Re: [XeTeX] How to prevent Chinese chars to be treated as<br>
part of TeX command?<br>
Message-ID: <1255757130448908000029de@sniffer><br>
Content-Type: text/plain; charset=iso-2022-jp<br>
<br>
> Such errors occur when chinese characters (or any other non-ASCII unicode<br>
> chars) follow a valid command immediately.<br>
> In other words, if there is no space between Chinese characters and a<br>
> command name,<br>
> XeTeX will treat the Chinese characters as part of the command name, so it<br>
> issues an error message. I do not know whether it is a bug of XeTeX or it<br>
> is intended.<br>
<br>
That is not a bug and apparently intentional.<br>
<br>
Best,<br>
Akira<br>
<br>
<br>
<br>
------------------------------<br>
<br>
Message: 5<br>
Date: Sat, 17 Oct 2009 07:02:15 +0100<br>
From: Joseph Wright <<a href="mailto:joseph.wright@morningstar2.co.uk">joseph.wright@morningstar2.co.uk</a>><br>
To: Unicode-based TeX for Mac OS X and other platforms <<a href="mailto:xetex@tug.org">xetex@tug.org</a>><br>
Subject: Re: [XeTeX] How to prevent Chinese chars to be treated as<br>
part of TeX command?<br>
Message-ID: <<a href="mailto:4AD95DE7.7050103@morningstar2.co.uk">4AD95DE7.7050103@morningstar2.co.uk</a>><br>
Content-Type: text/plain; charset=GB2312<br>
<br>
mhbezine209 mhbezine2009 wrote:<br>
> I find a problem of XeTeX: I often encounter errors like<br>
> "! Undefined control sequence l.6 \TeX???"<br>
> when I typeset Chinese documents with XeTeX.<br>
> See example below to have an idea on the source of errors.<br>
> ------cut from here----------<br>
> \documentclass{article}<br>
> \usepackage{xeCJK}<br>
> \begin{document}<br>
> \TeX??Hello<br>
> \end{document}<br>
> -------end----------------------<br>
><br>
> Such errors occur when chinese characters (or any other non-ASCII unicode<br>
> chars) follow a valid command immediately.<br>
> In other words, if there is no space between Chinese characters and a<br>
> command name,<br>
> XeTeX will treat the Chinese characters as part of the command name, so it<br>
> issues an error message. I do not know whether it is a bug of XeTeX or it<br>
> is intended. Anyway, I find this design is very annoying because I must<br>
> manually add a white space or {} after each command name so as to avoid such<br>
> errors. Does anybody to have good solution to resolve this problem? It would<br>
> be disirable if this feature of XeTeX can be disabled with one command or a<br>
> macro. I think it would be better to restrict command names in ASCII chars.<br>
> Thanks for any discussion on this issue:-)<br>
><br>
<br>
TeX treats any "letters" as part of a control sequence, so if I write:<br>
<br>
\TeXHello<br>
<br>
TeX will complain and I need to write<br>
<br>
\TeX Hello. All XeTeX is doing is extending this concept to UTF-8 by<br>
setting a lot<br>
more characters up as "letters". So everything seems pretty consistent<br>
to me.<br>
Most users want to use non-ASCII characters in csnames with XeTeX, in<br>
any case.<br>
--<br>
Joseph Wright<br>
<br>
--<br>
Joseph Wright Tel. 01604 810094<br>
Morning Star Mobile 07974 148180<br>
2 Dowthorpe End<br>
Earls Barton<br>
Northants NN6 0NH<br>
<br>
<br>
------------------------------<br>
<br>
Message: 6<br>
Date: Sat, 17 Oct 2009 01:44:49 -0700<br>
From: Michiel Kamermans <<a href="mailto:pomax@nihongoresources.com">pomax@nihongoresources.com</a>><br>
To: Unicode-based TeX for Mac OS X and other platforms <<a href="mailto:xetex@tug.org">xetex@tug.org</a>><br>
Subject: Re: [XeTeX] How to prevent Chinese chars to be treated as<br>
part of TeX command?<br>
Message-ID: <<a href="mailto:4AD98401.6000307@nihongoresources.com">4AD98401.6000307@nihongoresources.com</a>><br>
Content-Type: text/plain; charset=GB2312<br>
<br>
mhbezine2009 wrote:<br>
> I find a problem of XeTeX: I often encounter errors like "! Undefined<br>
> control sequence l.6 \TeX???" when I typeset Chinese documents with<br>
> XeTeX.<br>
Be aware that in TeX, commands without arguments need to be<br>
'terminated': you must use "\TeX ??", so that the TeX engine can go<br>
"aha, first process '\TeX', which is terminated by ' ' (which I will not<br>
interpret as an actual character, but as terminator), and then the text<br>
'??'" so your final text will look like "TeX??" with the appropriate<br>
macro replacement. Because XeTeX is unicode aware, using "\TeX??"<br>
means it will look for the command "TeX??" somewhere in your documents<br>
definitions list, and then can't find it, so you get your error.<br>
<br>
Even though there are no spaces in Chinese (and various other<br>
languages), you will still need to use them in your document to<br>
terminate commands without arguments. Regular commands with arguments<br>
should be fine, since their control sequence is terminated by the<br>
accolades that surround arguments, but commands without arguments are<br>
always tricky this way.<br>
<br>
It's also why an English text "I am writing \TeX code, look at me" will<br>
come out as "I am writing TeXcode, look at me". There, too, the first<br>
non-command character that follows a command without arguments is<br>
considered a terminator, not a character to place on the page (which is<br>
why for languages with spaces, the advice is usually to add an extra<br>
slash behind the command, so that TeX sees the slash as terminator,<br>
instead of the character that follows)<br>
<br>
Because argument count is not enforced by TeX (you'll just get an error<br>
if you use the wrong number of them), you can also use an empty argument<br>
with commands that don't take arguments: "\TeX{}??" will also do what<br>
you want it to do, and might be easier if you're in an input mode that<br>
makes typing spaces harder than typing accolades.<br>
<br>
- Mike "Pomax" Kamermans<br>
<a href="http://nihongoresources.com" target="_blank">nihongoresources.com</a><br>
<br>
<br>
------------------------------<br>
<br>
_______________________________________________<br>
XeTeX mailing list<br>
<a href="mailto:XeTeX@tug.org">XeTeX@tug.org</a><br>
<a href="http://tug.org/mailman/listinfo/xetex" target="_blank">http://tug.org/mailman/listinfo/xetex</a><br>
<br>
<br>
End of XeTeX Digest, Vol 67, Issue 40<br>
*************************************<br>
</blockquote></div><br>