main
jaybubs 2022-06-29 10:21:30 +08:00
commit 838c3b8843
Signed by: jayjay
GPG Key ID: 9D0BF5FB98287573
3 changed files with 64 additions and 0 deletions

54
physjax.js Normal file
View File

@ -0,0 +1,54 @@
//
// Initialize the MathJax startup code
//
require('mathjax-full/components/src/startup/lib/startup.js');
//
// Get the loader module and indicate the modules that
// will be loaded by hand below
//
const {Loader} = require('mathjax-full/js/components/loader.js');
Loader.preLoad(
'loader', 'startup',
'core',
'input/tex-base',
'[tex]/ams',
'[tex]/newcommand',
'[tex]/configmacros',
'[tex]/physics',
'output/svg', 'output/svg/fonts/tex.js',
'ui/menu'
);
//
// Load the components that we want to combine into one component
// (the ones listed in the preLoad() call above)
//
require('mathjax-full/components/src/core/core.js');
require('mathjax-full/components/src/input/tex-base/tex-base.js');
require('mathjax-full/components/src/input/tex/extensions/ams/ams.js');
require('mathjax-full/components/src/input/tex/extensions/newcommand/newcommand.js');
require('mathjax-full/components/src/input/tex/extensions/configmacros/configmacros.js');
require('mathjax-full/components/src/output/svg/svg.js');
require('mathjax-full/components/src/output/svg/fonts/tex/tex.js');
require('mathjax-full/components/src/ui/menu/menu.js');
require('mathjax-full/components/src/input/tex/extensions/physics/physics.js');
//
// Update the configuration to include any updated values
//
const {insert} = require('mathjax-full/js/util/Options.js');
insert(MathJax.config, {
tex: {
packages: {'[+]': ['ams', 'newcommand', 'configmacros','physics']}
}
});
//
// Loading this component will cause all the normal startup
// operations to be performed
//
require('mathjax-full/components/src/startup/startup.js');

1
physjax.min.js vendored Normal file

File diff suppressed because one or more lines are too long

9
webpack.config.js Normal file
View File

@ -0,0 +1,9 @@
const PACKAGE = require('mathjax-full/components/webpack.common.js');
module.exports = PACKAGE(
'physjax', // the name of the package to build
'../node_modules/mathjax-full/js', // location of the mathjax library
[], // packages to link to
__dirname, // our directory
'.' // where to put the packaged component
);