Here is a patch and an analysis of my problem. Patch:
--- /usr/share/texmf/tex/latex/preview/preview.sty Sun Apr 3 15:28:162005 +++ preview.sty Sat Jun 4 21:10:33 2005 @@ -117,10 +117,12 @@ \DeclareOption{textmath}{% \PreviewEnvironment{math}% [EMAIL PROTECTED]@undefined \let#1=$%$ \fi\catcode`\$=\active - [EMAIL PROTECTED] + [EMAIL PROTECTED] + \count255=\the\catcode`\@ + [EMAIL PROTECTED] [EMAIL PROTECTED]@ship\([EMAIL PROTECTED] \) [EMAIL PROTECTED]@[EMAIL PROTECTED] [EMAIL PROTECTED]@textmathcheck}}{}}% [EMAIL PROTECTED]@endaftergroup [EMAIL PROTECTED]@gobbletwo\fi#2}} The aim of the patch is ensuring that \xyunrecatcode is called with @ having category character and then restoring the category of @. The category code of @ is temporarily stored in \count255. (There is no particular reason for choosing \count255. Any temporary storage will do.) Analysis: 1) preview.sty intentionally changes the category of $ to active with the options active and textmath. 2) The xy-pic package sometimes also changes the category code of characters and then changes them back. This backward change is done by the \xyuncatcode macro which contains _explicitly_ the category codes valid when processing the document. 3) The macro \xyreuncatcode configures \xyuncatcode to contain the correct codes. It should be called when the category codes are that for the document. 4) It follows that if preview.sty changes the category code of $ _after_ xy_pic is loaded then it must call \xyreuncatcode to correctly setup \xyuncatcode. 5) However, the problem is then while loading a package LaTeX temporarily changes the category code of @. That is why we need to change the category of @ before \xyreuncatcode and then restore it for proper operation. 6) There is a further complication: this part of code is in the argument of [EMAIL PROTECTED] This means that it is executed immediately (during loading the package) if preview.sty is given the option 'active' but not 'delayed'. If 'delayed' is also given the code is executed at \begin{document} time when the category of @ is other. 7) It follows that to what category we need to restore @ depends on when the code is executed. So the patch saves the category code in advance to know what to restore. Kind regards, Gabor Braun -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]