diff --git a/ts/input/tex/textcomp/TextcompConfiguration.ts b/ts/input/tex/textcomp/TextcompConfiguration.ts index 2588168dc..820acc984 100644 --- a/ts/input/tex/textcomp/TextcompConfiguration.ts +++ b/ts/input/tex/textcomp/TextcompConfiguration.ts @@ -25,10 +25,19 @@ import {Configuration} from '../Configuration.js'; import './TextcompMappings.js'; +Configuration.create('text-textcomp', { + parser: 'text', + handler: {macro: ['textcomp-macros']} +}); export const TextcompConfiguration = Configuration.create( 'textcomp', { - handler: {macro: ['textcomp-macros']} + handler: {macro: ['textcomp-macros']}, + config(_config, jax) { + const {textConf, parseOptions} = jax.parseOptions.packageData.get('textmacros'); + parseOptions.options.textmacros.packages.push('text-textcomp'); + textConf.add('text-textcomp', jax, {}); + } } ); diff --git a/ts/input/tex/textmacros/TextMacrosConfiguration.ts b/ts/input/tex/textmacros/TextMacrosConfiguration.ts index f0de1095b..5e2e4f59e 100644 --- a/ts/input/tex/textmacros/TextMacrosConfiguration.ts +++ b/ts/input/tex/textmacros/TextMacrosConfiguration.ts @@ -39,6 +39,7 @@ import './TextMacrosMappings.js'; */ export const TextBaseConfiguration = Configuration.create('text-base', { parser: 'text', + priority: 1, handler: { character: ['command', 'text-special'], macro: ['text-macros'] @@ -96,6 +97,7 @@ function internalMath(parser: TexParser, text: string, level?: number | string, // The textmacros package configuration // export const TextMacrosConfiguration = Configuration.create('textmacros', { + priority: 1, /** * @param {ParserConfiguration} config The configuration object we are being configured within * @param {TeX} jax The TeX input jax in which we are running @@ -120,7 +122,7 @@ export const TextMacrosConfiguration = Configuration.create('textmacros', { // and replace the internalMath function with our own. // parseOptions.packageData = jax.parseOptions.packageData; - parseOptions.packageData.set('textmacros', {parseOptions, jax, texParser: null}); + parseOptions.packageData.set('textmacros', {textConf, parseOptions, jax, texParser: null}); parseOptions.options.internalMath = internalMath; }, preprocessors: [(data: {data: ParseOptions}) => {