Skip to content

Size of root() in asciimath and sans serif

Davide P. Cervone edited this page May 28, 2013 · 2 revisions

Following on from the discussion about obtaining sans-seirf output, I'm wondering if there is a way to define a global change for the size of the nth-root character, for example, the n in root(n)a.

I'm using ASCIIMathML input.

I'd also like to target that nth-root character (but no others) with the \sf handle, to help readability.

While I'm at it, I'd like to ask how to increase the size of fractional exponents, e.g. the m and n in a^(m/n).

Thanks for your untiring, and inspiring, help.


Following on from the discussion about obtaining sans-seirf output, I'm wondering if there is a way to define a global change for the size of the nth-root character, for example, the n in root(n)a.

The size of the roots (as well as superscript, subscripts, and all smaller elements like that) is controlled by the MathML scriptsizemultiplier value, though you don't have direct access to that via the AsciiMath input format. There were some discussions about this in the past for the TeX input jax. See

The latter is quite old, but it does still work (though the thing about "anonymous Jax" is no longer needed). There are better tools now for making the global modification than the one listed there. For example,

MathJax.Hub.Register.StartupHook("AsciiMath Jax Ready",function () {
  MathJax.InputJax.AsciiMath.postfilterHooks.Add(function (data) {
    data.math.root.scriptsizemultiplier = .8;
  });
});

would be better than the code listed in the SourceForge address.

It is also possible to set the scriptminsize as well, which controls the smallest size that is allowed (default is 8pt as I recall).

Note that this affects all super- and subscripts, not just the roots.

I'd also like to target that nth-root character (but no others) with the "\sf" handle, to help readability.

I don't know of a reasonable way to do that. The AsciiMath input jax uses the ASCIIMathML code directly, and that is not designed for user modification, as MathJax is. So there is no easy place to patch into that. It would be possible to use the postfilter hook to walk the resulting MathML tree and look for roots, but I don't think it is worth it. Changing the script multiplier probably is enough. Or setting the global math scaling factor might be a better alternative.

While I'm at it, I'd like to ask how to increase the size of fractional exponents, e.g. the m and n in a^(m/n).

The code above will do that (along with all other exponents). Again, it is not easy to target a specific situation, but you can change the global multiplier.

Davide

Clone this wiki locally