<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 &quot;letters&quot;. 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 &quot;@&quot; to chinese characters (including chinese punctuations) since it would look more natural not to insert odd spaces or &quot;\ &quot; for Chinese typesetting.<br>
</div><br><div class="gmail_quote">2009/10/17  <span dir="ltr">&lt;<a href="mailto:xetex-request@tug.org">xetex-request@tug.org</a>&gt;</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 &#39;help&#39; 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 &quot;Re: Contents of XeTeX digest...&quot;<br>
<br>
<br>
Today&#39;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 &lt;<a href="mailto:oinos@web.de">oinos@web.de</a>&gt;<br>
To: Unicode-based TeX for Mac OS X and other platforms &lt;<a href="mailto:xetex@tug.org">xetex@tug.org</a>&gt;<br>
Subject: Re: [XeTeX] wrong alignment with optical bounds<br>
Message-ID: &lt;<a href="mailto:4AD8D118.10400@web.de">4AD8D118.10400@web.de</a>&gt;<br>
Content-Type: text/plain; charset=UTF-8<br>
<br>
Jonathan Kew wrote:<br>
&gt; On 10 Oct 2009, at 18:45, Pablo Rodr?guez wrote:<br>
&gt;<br>
&gt;&gt; Hi Jonathan and others,<br>
&gt;&gt;<br>
&gt;&gt; I have just tried the following code:<br>
&gt;&gt;<br>
&gt;&gt; \documentclass[12pt]{article}<br>
&gt;&gt; \usepackage[a5paper]{geometry}<br>
&gt;&gt; \usepackage{fontspec}<br>
&gt;&gt; \fontspec[RawFeature=+opbd;-liga]{Grandjean Baskerville}<br>
&gt;&gt; \begin{verse}<br>
&gt;&gt; ???????? ???\\<br>
&gt;&gt; ??? ???? ?? ??????\\<br>
&gt;&gt; ????? ????\\<br>
&gt;&gt; ??? ????????.<br>
&gt;&gt; \end{verse}<br>
&gt;&gt; \end{document}<br>
&gt;&gt;<br>
&gt;&gt; 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>
&gt;&gt; applying the optical bound to the first letter in text, but it also<br>
&gt;&gt; creates a kind of positive kerning with the next letter.<br>
&gt;&gt;<br>
&gt;&gt; I guess this might be a bug.<br>
&gt;<br>
&gt; I&#39;m afraid you&#39;re trying to do something that simply isn&#39;t supported.<br>
&gt; The OpenType features for optical bounds require the application to<br>
&gt; apply different lookups depending on where the glyph occurs on the line,<br>
&gt; but xetex does not support this; it applies the features you specify to<br>
&gt; the entire run of text, *before* line-breaking decisions have been made,<br>
&gt; so it cannot apply them contextually depending whether the glyph is<br>
&gt; 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>
&gt; The spacing after the initial ? in your PDF does look odd; this may have<br>
&gt; something to do with the type of OpenType lookup that has been used in<br>
&gt; that font. This may well be a bug. However, regardless of that, I don&#39;t<br>
&gt; think you can usefully use OT features in this way at the moment.<br>
&gt; Consider what would happen if a word beginning with ? occurred in the<br>
&gt; middle of a line: it would end up intruding into the preceding<br>
&gt; inter-word space, because the feature is being applied indiscriminately.<br>
<br>
First of all, I&#39;m not 100% sure that the bug in the odd space is not<br>
caused by the font, since I don&#39;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 &lt;<a href="mailto:pomax@nihongoresources.com">pomax@nihongoresources.com</a>&gt;<br>
To: XeTeX Mailing List &lt;<a href="mailto:xetex@tug.org">xetex@tug.org</a>&gt;<br>
Subject: [XeTeX] getting \newXeTeXintercharclass to work<br>
Message-ID: &lt;<a href="mailto:4AD8E2A2.9040107@nihongoresources.com">4AD8E2A2.9040107@nihongoresources.com</a>&gt;<br>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed<br>
<br>
Hi,<br>
<br>
I&#39;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&#39;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 &quot;Pomax&quot; 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 &lt;<a href="mailto:mhbezine2009@gmail.com">mhbezine2009@gmail.com</a>&gt;<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>
        &lt;<a href="mailto:8004fc3c0910162034u47afb0b9p2a6e55146c30ba46@mail.gmail.com">8004fc3c0910162034u47afb0b9p2a6e55146c30ba46@mail.gmail.com</a>&gt;<br>
Content-Type: text/plain; charset=&quot;gb2312&quot;<br>
<br>
I find a problem of XeTeX: I often encounter errors like<br>
&quot;! Undefined control sequence l.6 \TeX???&quot;<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: &lt;<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>&gt;<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: &lt;<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>&gt;<br>
<br>
------------------------------<br>
<br>
Message: 4<br>
Date: Sat, 17 Oct 2009 14:25:30 +0900<br>
From: &quot;Akira Kakuto&quot; &lt;<a href="mailto:kakuto@fuk.kindai.ac.jp">kakuto@fuk.kindai.ac.jp</a>&gt;<br>
To: Unicode-based TeX for Mac OS X and other platforms &lt;<a href="mailto:xetex@tug.org">xetex@tug.org</a>&gt;<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: &lt;1255757130448908000029de@sniffer&gt;<br>
Content-Type: text/plain; charset=iso-2022-jp<br>
<br>
&gt; Such errors occur when chinese characters (or any other non-ASCII unicode<br>
&gt; chars) follow a valid command immediately.<br>
&gt; In other words, if there is no space between Chinese characters and a<br>
&gt; command name,<br>
&gt; XeTeX will treat the Chinese characters as part of the command name, so it<br>
&gt; issues an error message.  I do not know whether it is a bug of XeTeX or it<br>
&gt; 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 &lt;<a href="mailto:joseph.wright@morningstar2.co.uk">joseph.wright@morningstar2.co.uk</a>&gt;<br>
To: Unicode-based TeX for Mac OS X and other platforms &lt;<a href="mailto:xetex@tug.org">xetex@tug.org</a>&gt;<br>
Subject: Re: [XeTeX] How to prevent Chinese chars to be treated as<br>
        part of TeX     command?<br>
Message-ID: &lt;<a href="mailto:4AD95DE7.7050103@morningstar2.co.uk">4AD95DE7.7050103@morningstar2.co.uk</a>&gt;<br>
Content-Type: text/plain; charset=GB2312<br>
<br>
mhbezine209 mhbezine2009 wrote:<br>
&gt; I find a problem of XeTeX: I often encounter errors like<br>
&gt; &quot;! Undefined control sequence l.6 \TeX???&quot;<br>
&gt; when I typeset Chinese documents with XeTeX.<br>
&gt; See example below to have an idea on the source of errors.<br>
&gt; ------cut from here----------<br>
&gt; \documentclass{article}<br>
&gt; \usepackage{xeCJK}<br>
&gt; \begin{document}<br>
&gt; \TeX??Hello<br>
&gt; \end{document}<br>
&gt; -------end----------------------<br>
&gt;<br>
&gt; Such errors occur when chinese characters (or any other non-ASCII unicode<br>
&gt; chars) follow a valid command immediately.<br>
&gt; In other words, if there is no space between Chinese characters and a<br>
&gt; command name,<br>
&gt; XeTeX will treat the Chinese characters as part of the command name, so it<br>
&gt; issues an error message.  I do not know whether it is a bug of XeTeX or it<br>
&gt; is intended. Anyway, I find this design is very annoying because I must<br>
&gt; manually add a white space or {} after each command name so as to avoid such<br>
&gt; errors. Does anybody to have good solution to resolve this problem? It would<br>
&gt; be disirable if this feature of XeTeX can be disabled with one command or a<br>
&gt; macro. I think it would be better to restrict command names in ASCII chars.<br>
&gt; Thanks for any discussion on this issue:-)<br>
&gt;<br>
<br>
TeX treats any &quot;letters&quot; 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 &quot;letters&quot;. 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 &lt;<a href="mailto:pomax@nihongoresources.com">pomax@nihongoresources.com</a>&gt;<br>
To: Unicode-based TeX for Mac OS X and other platforms &lt;<a href="mailto:xetex@tug.org">xetex@tug.org</a>&gt;<br>
Subject: Re: [XeTeX] How to prevent Chinese chars to be treated as<br>
        part of TeX     command?<br>
Message-ID: &lt;<a href="mailto:4AD98401.6000307@nihongoresources.com">4AD98401.6000307@nihongoresources.com</a>&gt;<br>
Content-Type: text/plain; charset=GB2312<br>
<br>
mhbezine2009 wrote:<br>
&gt; I find a problem of XeTeX: I often encounter errors like &quot;! Undefined<br>
&gt; control sequence l.6 \TeX???&quot; when I typeset Chinese documents with<br>
&gt; XeTeX.<br>
Be aware that in TeX, commands without arguments need to be<br>
&#39;terminated&#39;: you must use &quot;\TeX ??&quot;, so that the TeX engine can go<br>
&quot;aha, first process &#39;\TeX&#39;, which is terminated by &#39; &#39; (which I will not<br>
interpret as an actual character, but as terminator), and then the text<br>
&#39;??&#39;&quot; so your final text will look like &quot;TeX??&quot; with the appropriate<br>
macro replacement. Because XeTeX is unicode aware, using &quot;\TeX??&quot;<br>
means it will look for the command &quot;TeX??&quot; somewhere in your documents<br>
definitions list, and then can&#39;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&#39;s also why an English text &quot;I am writing \TeX code, look at me&quot; will<br>
come out as &quot;I am writing TeXcode, look at me&quot;. 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&#39;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&#39;t take arguments: &quot;\TeX{}??&quot; will also do what<br>
you want it to do, and might be easier if you&#39;re in an input mode that<br>
makes typing spaces harder than typing accolades.<br>
<br>
- Mike &quot;Pomax&quot; 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>