Here is a configuration that can be used to make \symbf and \symsf (the only two that seem to be affected) to apply the Latin and Greek italic styles specified by the mathStyle option in the tex block of the MathJax configuration.
tex: {packages: {'[+]': ['my-sym']}},
const {Configuration} = MathJax._.input.tex.Configuration;
const {CommandMap} = MathJax._.input.tex.TokenMap;
const {MapHandler} = MathJax._.input.tex.MapHandler;
const {TexConstant} = MathJax._.input.tex.TexConstants;
const TexParser = MathJax._.input.tex.TexParser.default;
const ParseUtil = MathJax._.input.tex.ParseUtil.default;
const NodeUtil = MathJax._.input.tex.NodeUtil.default;
const {getRange} = MathJax._.core.MmlTree.OperatorDictionary;
const MATHVARIANT = TexConstant.Variant;
function Other(parser, char) {
const font = parser.stack.env['font'];
const ifont = parser.stack.env['italicFont'];
let def = font ? {mathvariant: font} : {};
const remap = MapHandler.getMap('remap').lookup(char);
const range = getRange(char);
let mo = parser.create('token', type, def, (remap ? remap.char : char));
const style = (ParseUtil.isLatinOrGreekChar(char) ? parser.configuration.mathStyle(char, true) || ifont : '');
const variant = (range[4] || (font && style === MATHVARIANT.NORMAL? '' : style));
mo.attributes.set('mathvariant', variant);
NodeUtil.setProperty(mo, 'fixStretchy', true);
parser.configuration.addNode('fixStretchy', mo);
new CommandMap('my-sym', {
symbf: ['MathFont', MATHVARIANT.BOLD, MATHVARIANT.BOLDITALIC],
symsf: ['MathFont', MATHVARIANT.SANSSERIF, MATHVARIANT.SANSSERIFITALIC]
MathFont(parser, name, variant, italic) {
const text = parser.GetArgument(name);
let mml = new TexParser(text, {
multiLetterIdentifiers: parser.options.identifierPattern,
}, parser.configuration).mml();
parser.Push(parser.create('node', 'TeXAtom', [mml]));
Configuration.create('my-sym', {
MathJax.startup.defaultReady();