[Xy-pic] Conflict between unicode-math and xypic
Ross Moore
ross.moore at mq.edu.au
Sat Nov 13 05:05:30 CET 2010
Hi Daniel, Kris and Will
On 10/11/2010, at 8:49 AM, Daniel Müllner wrote:
> Hi Ross and all others,
>
> xypdf indeed uses a \fontdimen parameter: \fontdimen8\textfont3 for the default line width. Besides, it relies on other parameters calculated by Xy-pic, like \xydashl@ for the dash length and \xydashh@ for the separation of multiple strokes.
The patches in unicode-math.sty are related to
\fontdimen22 \textfont\tw@ .
This token sequence occurs in several places within the
various xy*.tex files.
That fact alone suggests that the token sequence should
be replaced by a macro.
As well as being superior (from the functional programming
point of view) it would make it easier to maintain; especially
for the situation in which \fontdimen22 doesn't exist.
You would just need to replace a single macro expansion with
something else that produces the desired value.
It might be even more efficient to use a dimension-register to
store the appropriate value. However, doing this might well require
that this register be checked to indeed hold the correct value;
e.g., if the font-size or face changes, then so would this value.
So staying with a macro may well be best.
>
> If unusual math font setups cannot provide these parameters, a patch should supply these. If there are better or more future-compatible ways of getting the math font parameters, please tell me so that I can adapt the methods in xypdf.
Indeed.
This is consistent with shifting any code that refers to specific
font parameters out of the main xy*.tex application and
extension files, and into another file whose purpose is more
like that of a driver.
Now supposing we have such a macro \xyfontxxii say,
with default expansion \fontdimen22 \textfont\tw@ ,
the questions become:
How is this to be patched?
When should it be patched?
Is having unicode-math.sty loaded sufficient to require
the macro be patched? Surely not.
There also needs to be an instance of \setmathfont ,
because a package should be able to be loaded,
without actually using its features.
Now there is the possibility that \setmathfont is used within
a group; so that some of the maths could be in older TeX style,
while some is done in unicode-math style.
Thus the patched expansion of \xyfontxxii needs to include
a test for the kind of mathematics support being used; or rather
the type of font being used. Slightly messy; but I'm confident
that the benefits will be worth it.
Similar arguments apply to any other place where Xy-pic (or xypdf)
needs to access font properties.
>
> Best,
>
> Daniel
So it looks like an Xy-pic 3.8.4 is on the horizon.
Cheers,
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 xy-pic
mailing list