[XeTeX] Bug between unicode-math and expex
Ross Moore
ross.moore at mq.edu.au
Wed Dec 22 00:28:04 CET 2010
Hi James,
On 22/12/2010, at 9:56 AM, James Crippen wrote:
> I’m using ExPex (not yet in CTAN, http://www.math.neu.edu/ling/tex/)
> for linguistic examples in XeLaTeX and I’ve encountered a bad
> interaction between it and unicode-math. Here’s a Minimal Working
> Example™:
>
> - - - cut here - - -
>
> \documentclass{article}
> \usepackage{fontspec}
> \usepackage{unicode-math}
> \usepackage{expex}
I don't have the expex package, but can still tell you
the cause of the problem.
In unicode-math-table.tex there is a line:
\UnicodeMathSymbol{"02AA5}{\gla }{\mathrel}{greater-than beside less-than}%
I don't know why the macro is called \gla here,
but I would be even more critical of the expex package
for its use of short macro names for complicated tasks.
The risk of a clash with another package, using the same
name quite naturally for a symbol (as here) or letter o
in a foreign language, is just too great.
I'd object to all these macro names in your example:
\pex \a \gla \glb \glc \xe
and the \begingl \endgl should be done as
\begin{gl} and \end{gl}
else there can be complications when combined with
other LaTeX environments.
Furthermore, I'd advise against it being accepted
at CTAN until these issues are fixed properly.
>
> \begin{document}
>
> \pex
> \a
> \begingl
> \gla mea mater sus mala est /
> \glb my mother pig bad is /
> \glc{‘my mother is a bad pig’}
> \endgl
> \a
> \begingl
> \gla mea mater sus mala est /
> \glb wander mother pig apple eats /
> \glc{‘wander, mother, the pig is eating the apples’}
> \endgl
> \xe
>
> \end{document}
Now having said everything above, your easiest workaround is
to adjust the preamble as follows:
>> \documentclass{article}
>> \usepackage{fontspec}
>> \usepackage{unicode-math}
>> \let\gla\relax
>> \usepackage{expex}
or as
>> \documentclass{article}
>> \usepackage{fontspec}
>> \usepackage{expex}
>> \let\expexgla\gla
>> \usepackage{unicode-math}
>> \let\gla\expexgla
At least one of these should work to skip over the problem,
provided you do not also want to use \gla as a math
character.
Other macro names may need to be treated similarly.
Without the expex.sty package, I cannot tell.
>
> - - - cut here - - -
>
> To get the correct output, comment out the \usepackage{unicode-math}.
> The wrong result is that line breaking fails to occur and the / shows
> up in the output.
>
> There is another incorrect output that I am having trouble getting an
> MWE to show. In this case the beginning of a multiline example (the
> thing started by \begingl) has the characters "><" at the beginning of
> the first line. I think this may be something inside of ExPex’s
> crossreference tagging (it uses <...> for xref tags) but I haven’t
> figured it out.
>
> Can someone who knows unicode-math figure out what is going wrong? I’d
> like to be able to use that package but this buggy interaction is
> preventing me because I need ExPex more than I do unicode-math.
>
> I am reporting this here because although it’s likely that there is
> some assumption in ExPex being violated, I think people who work on
> unicode-math are more likely to figure it out than the ExPex
> maintainer.
>
> Thanks,
> James Crippen
Hope this helps,
Ross
------------------------------------------------------------------------
Ross Moore ross.moore at mq.edu.au
Mathematics Department office: E7A-419
Macquarie University tel: +61 (0)2 9850 8955
Sydney, Australia 2109 fax: +61 (0)2 9850 8114
------------------------------------------------------------------------
More information about the XeTeX
mailing list