[XeTeX] Incompatibility between footmisc and xltxtra

Will Robertson wspr81 at gmail.com
Mon Feb 18 23:03:25 CET 2008


On 19/02/2008, at 4:38 AM, Bruno Voisin wrote:

> Le 18 févr. 08 à 18:41, Bruno Voisin a écrit :
>
>> Just a note to mention an incompatibility between the footmisc and
>> xltxtra packages.
>
> Looking more closely, this all seems to come down to the redefinition
> of \textsuperscript in xltxtra.sty, which doesn't seem to work for
> example with \textsuperscript{a,b}.

Yuck. You're right.
These real superscripts sure are a pain. The problem is that some  
fonts do have the necessary glyphs, and in that case you do want to  
use them. But there's no way of knowing inside XeTeX when that will  
be. Well, without a fair bit of mucking around.

Here's what I'll have to do to support this feature. JK, let me know  
if there's an easier way to do this :) I guess a \lastnode primitive  
is out of the question :)

You can hack this code to suit your purposes for now, and I'll  
incorporate it into xltxtra as soon as I can. It's possible that I  
should use this code to test *every character* passed into  
\superscript. Problem there is that it's hard to match the heights of  
the superscripts.

Thanks for the report,
Will

\documentclass[12pt]{article}
\makeatletter
\usepackage{xltxtra}
\begin{document}
\newsavebox\@tempboxb
\newcommand\xxt at check@supchar[1]{%
   \savebox\@tempboxa{#1}%
   \savebox\@tempboxb{\realsuperscript{#1}}%
   \@tempswatrue
   \ifdim\wd\@tempboxa=\wd\@tempboxb
     \ifdim\ht\@tempboxa=\ht\@tempboxb
       \ifdim\ht\@tempboxa=\ht\@tempboxb
         \@tempswafalse
   \fi\fi\fi
   \if at tempswa
     [ \usebox\@tempboxa \usebox\@tempboxb: supscript works:  
\realsuperscript{#1}
   \else
     [ \usebox\@tempboxa \usebox\@tempboxb: have to fake it:  
\fakesuperscript{#1}
   \fi]}
\setmainfont{Adobe Garamond Pro}
\xxt at check@supchar{a}
\xxt at check@supchar{\&}
\end{document}

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2415 bytes
Desc: not available
Url : http://tug.org/pipermail/xetex/attachments/20080219/2772ddf0/attachment.bin 


More information about the XeTeX mailing list