[XeTeX] Typographic consistency (was: CJK and ideographic font names)

Ross Moore ross at maths.mq.edu.au
Tue Sep 14 03:37:33 CEST 2004


Hi Jonathan, and everyone,


On 14/09/2004, at 5:58 AM, Jonathan Kew wrote:

>> The gobbling seems to be ultimately due to \char .
>> All (well mostly) the macros in  utf8accents.sty  expand
>> to give  \char"xxxx .
>> When the next token is a space, this gets gobbled.
>
> Yes, it would: standard TeX scanning rules say that it will consume  
> one (optional) space after a number. When the \char.... that results  
> from the utf8accents macros actually reads its argument, it will quite  
> happily read beyond the digits that were part of the same macro  
> definition. In fact, if the next thing happened to be another digit,  
> you'd get a completely different character!
>
>>
>> So I've appended an extra \relax  in some cases.
>> Now the space is preserved and results in the correct
>> word-separating space.
>
> I believe the most efficient thing to do is to explicitly include the  
> optional space in the macro, but that can look rather odd, so I would  
> often prefer \relax. Any macro whose expansion ends with a number that  
> TeX will scan for its numeric value may need this kind of precaution.  
> You might want to add \relax (or space) in all cases, not just some.

This is done by altering just 5 lines in the  utf8accents.sty  (v0.3)
file that I posted yesterday:

112:     
\expandafter\def\csname\UTFencname\string#8\endcsname{\char"#1#2#3#4\rel 
ax}%
143:     
\expandafter\def\csname\tmp at name\endcsname{\char"#1#2#3#4\relax}%
160:  \def\UTFchar{\char"#1#2#3#4\relax}%
165:\gdef\add at UTF@accent#1#2#3{#2\char"#1\relax}
166:\gdef\add at UTF@accents#1#2#3{#2\char"#1\char"#3\relax}

Note how these all now finish in   \relax} .

Also, the line-numbers here are for v0.4.
With the v0.3 file, they will be ~3 less, due to extra history comments.


The v0.3 file also has the date wrong on line 2; it should be   
2004/09/10 .


I'll wait for more changes/improvements/bug-fixes before posting a fresh
version to the list.  How many of you are actually making use of this
package, and for what purpose ?


Cheers,

	Ross

>
> JK
>
> _______________________________________________
> XeTeX mailing list
> postmaster at tug.org
> http://tug.org/mailman/listinfo/xetex
>
------------------------------------------------------------------------
Ross Moore                                         ross at maths.mq.edu.au
Mathematics Department                             office: E7A-419
Macquarie University                               tel: +61 +2 9850 8955
Sydney, Australia                                  fax: +61 +2 9850 8114
------------------------------------------------------------------------



More information about the XeTeX mailing list