[XeTeX] alphabets in maths and \mathbf

Ross Moore ross at ics.mq.edu.au
Tue Jan 26 20:25:00 CET 2010


Hi Vafa,

On 26/01/2010, at 5:57 PM, Vafa Khalighi wrote:

> Sorry, but I have been looking for responses to my original  
> question. Is there any way, that you can change the maths font  
> inside \mathbf command, but you only change the font of digits and  
> not the font of alphabets inside \mathbf.

\mathbf  ultimately expands to  \mathgroup 4 .
where  \mathgroup  is just an alias for the TeX primitive  \fam .

(At least that is what it did for me with a very simple test.)

The actual font has been set by:

   \DeclareMathAlphabet      {\mathbf}{OT1}{cmr}{bx}{n}

in LaTeX's  fontmath.ltx  file.


There are various way to hack into the math-family coding to make
something else happen. Easiest is probably to use an alternative
  \DeclareMathAlphabet  and/or  \SetMathAlphabet  instance.

However, this changes letters as well as digits.

>
> I am not looking for mathspec, unicode-math or whatever. I am  
> looking for a response to my question.

To change the font for digits only, I'd guess that you will need
to change the mathcode of each digit to become `8000.
That is, the digit becomes active in math, but not active in text.

Set the expansions of these active characters to locally switch
to the font you want, then place the required (non-active) character.

There's some non-trivial programming here, to make this work
only within a call to  \mathbf  and to ensure that there are no
unwanted side-effects.


> -- 
> Best wishes,
> Vafa Khalighi


Hope this helps,

	Ross

------------------------------------------------------------------------
Ross Moore                                       ross at maths.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