[XeTeX] XeTeX Digest, Vol 67, Issue 40

mhbezine209 mhbezine2009 mhbezine2009 at gmail.com
Sat Oct 17 12:21:41 CEST 2009


Many thanks  for discussions on my issue!
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.

2009/10/17 <xetex-request at tug.org>

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


More information about the XeTeX mailing list