unicode-math icon indicating copy to clipboard operation
unicode-math copied to clipboard

Call \DeclareMathSizes for all sizes

Open wspr opened this issue 6 years ago • 3 comments
trafficstars

Currently we only run:

    \DeclareMathSizes { \f@size } { \f@size }
      { \@@_fontdimen_to_scale:nN {10} \g_@@_trial_font }
      { \@@_fontdimen_to_scale:nN {11} \g_@@_trial_font }

But really we need to copy the kernel and repeat this for all sizes:

\DeclareMathSizes{5}{5}{5}{5}
\DeclareMathSizes{6}{6}{5}{5}
\DeclareMathSizes{7}{7}{5}{5}
\DeclareMathSizes{8}{8}{6}{5}
\DeclareMathSizes{9}{9}{6}{5}
...

wspr avatar Feb 12 '19 11:02 wspr

Not sure about this… I have two major concerns:

  1. The 5pt lower bound. The math sizes simply do not go under 5pt in standard usage, to maintain legibility I suppose. I certainly cannot read something with, say, \DeclareMathSizes{6}{6}{4.2}{3}.

  2. One cannot consider everything. In Chinese typesetting, different standard font sizes apply. So the ctex classes have a completely independent set of \DeclareMathSizes:

    % Something of equivalence from the ctex classes:
    \DeclareMathSizes{5bp}{5bp}{5}{5}
    ...
    \DeclareMathSizes{10.5bp}{10.5bp}{7}{5}
    ...
    \DeclareMathSizes{15bp}{15bp}{12bp}{9bp}
    ...
    

    So even after calling \DeclareMathSizes for all sizes in the kernel, we are potentially missing out other sizes. Thus, I do not think it is worthwhile.

Overall, I think changing only the \normalsize suffices. The other sizes should be determined by either the class authors or the individual users. People who really care about typography will know how to setup the other sizes, provided that this is well-documented.

What unicode-math can do is to overwrite \defaultscriptratio and \defaultscriptscriptratio.

RuixiZhang42 avatar Feb 13 '19 16:02 RuixiZhang42

It’s a good point that we need to provide the flexibility to customise… I’m not convinced that sticking with the class or 2e defaults is the best approach though. The complication of course comes from the fact that the defaults are set up in a nonlinear way, so it’s hard to interpolate based on the font sizes. (Unless the maths font itself has optical sizes… I suppose I need to test more with Minion Math.)

wspr avatar Feb 13 '19 22:02 wspr

It’s a good point that we need to provide the flexibility to customise…

Maybe a “three-way” option on how aggressive unicode-math should re-declare math sizes?

  • <key>=None being to honor the kernel/class;
  • <key>=OnlyNormalSize or <key>=OnlyBodyText being the current implementation (which should be the default);
  • <key>=All being to overwrite all math sizes.

The complication of course comes from the fact that the defaults are set up in a nonlinear way

Also the fact that Computer Modern comes at discrete sizes and no smaller than 5pt

RuixiZhang42 avatar Feb 14 '19 05:02 RuixiZhang42