MathJax icon indicating copy to clipboard operation
MathJax copied to clipboard

footnotesize not recognised as a font size command

Open jpdehollain opened this issue 1 year ago • 1 comments

Issue Summary

When I try to use the font size command \footnotesize, mathjax does not recognise it.

Steps to Reproduce:

  1. Write and render a formula, which includes a font size command, e.g., a + {\footnotesize b} = {\huge c} renders $a + {\footnotesize b} = {\huge c}$.

The list of standard LaTeX font size commands is:

\tiny
\scriptsize
\footnotesize
\small
\normalsize
\large
\Large
\LARGE
\huge
\Huge

All work except \footnotesize.

jpdehollain avatar Sep 04 '24 05:09 jpdehollain

Well, \footnotesize is not really a math-mode command, which is why it wasn't included. It also varies from one document style to another. The other sizes are based on the standard sizes of the fonts available from the earlier days of TeX (when you needed to run meta font to create bitmapped fonts).

If you want to define \footnotesize, you can do so via the following configuration:

MathJax = {
  startup: {
    ready() {
      const {MapHandler} = MathJax._.input.tex.MapHandler;
      const {Macro} = MathJax._.input.tex.Symbol;
      const BaseMethods = MathJax._.input.tex.base.BaseMethods.default;
      const macros = MapHandler.getMap('macros');
      macros.add('footnotesize', new Macro('footnotesize', BaseMethods.SetSize, [.775]));
      MathJax.startup.defaultReady();
    }
  }
};

Here, I've made the size for it be half way between \small and \scriptsize, but you can set that to whatever you want.

dpvc avatar Sep 21 '24 14:09 dpvc