On 28/05/2010 07:14, Will Robertson wrote:
This gist of the problem was that siunitx was using things like

\setbox...@tempboxa=\hbox{%
$\mathsf{\global\chardef...@fam@sf=\fam}$}%

and then

\ifnum\the\fam=...@fam@sf

to detect when maths alphabets were available.

Since unicode-math doesn't use a different fam for each alphabet those
tests were breaking.

(The current implementation of unicode-math very inefficiently uses
mathcode remapping to effect the maths font switching. But at least it
works and is flexible for now. Future plans are to merge breqn's
"everything active" approach to improve efficiency and compatibility
with that package.)

I haven't actually checked yet, however, whether siunitx v2 gives
correct output while inside a unicode-math \mathsf. I'd be surprised if
it did.

The approach hasn't really changes:

\cs_set_protected_nopar:Npn \_siunitx_set_math_fam:n #1 {
  \int_new:c { _c_siunitx_math #1 _int }
  \group_begin:
    \hbox_set:Nn \_l_siunitx_tmp_box
      {
        \ensuremath
          {
            \use:c { math #1 }
              {
                \int_gset:cn { _c_siunitx_math #1 _int } { \fam }
              }
          }
      }
  \group_end:
}
\tl_put_right:Nn \document {
  \_siunitx_set_math_fam:n { sf }
  \_siunitx_set_math_fam:n { tt }
}

How should math family be picked up when unicode-math is loaded? I can soon fork the detection method if I know what I'm looking for.
--
Joseph Wright


--------------------------------------------------
Subscriptions, Archive, and List information, etc.:
 http://tug.org/mailman/listinfo/xetex

Reply via email to