我正在尝试在我的ionic2应用程序中运行mathjax。谁能告诉我如何使用mathjax -grunt cleaner来减小mathjax的大小?
到目前为止,我已经使用NPM + donwload mathjax latest +从github下载MathJax- grunt cleaner安装了grunt。
在那之后需要帮助。
发布于 2017-01-14 04:29:42
我需要为我的Ionic2应用程序使用MathJax,并且我遵循了与您所遵循的相同的步骤(grunt-cleaner)。您可以下载调整大小的mathjax文件夹here以将其包含在您的项目中:
www文件夹中。 <script type="text/x-mathjax-config">
MathJax.Hub.Config({tex2jax: {inlineMath: [['$$','$$'],['$','$'], ['\(','\)']]}});
</script>
<script type="text/javascript" src="mathjax/MathJax.js?config=default">
</script>发布于 2020-06-18 16:08:21
我不是Grunt或MatJax的专家,但它对我很有效
// download and extract mathjax
curl -J -O https://codeload.github.com/mathjax/MathJax/zip/2.7.8
unzip MathJax-2.7.8.zip
rm MathJax-2.7.8.zip
cd MathJax-2.7.8
// download the grunt file
curl -J -O https://raw.githubusercontent.com/mathjax/MathJax-grunt-cleaner/master/Gruntfile.js
// install grunt
npm install -g grunt-cli
npm install grunt grunt-contrib-clean grunt-regex-replace --save-dev
// in Gruntfile.js edit the "template" job, or copy it, we wanted to use only html-formulars so i commented out (to keep it)
//"clean:packed"
//"clean:fontTeX"
//"clean:woff"
//"clean:texInput"
//"clean:htmlCssOutput"
//"clean:extensionsTeX"
//"clean:extensionHtmlCss"
//"clean:allConfigs"
//"clean:dropFonts"
It looks like that now:
grunt.registerTask("template", [
// **Notes** on the template. When instructions say "Pick one", this means commenting out one item (so that it"s not cleaned).
//
// Early choices.
"clean:unpacked",
//"clean:packed", // pick one -- packed for production, unpacked for development.
//"clean:allConfigs", // if you do not need any combined configuration files.
// Fonts. Pick at least one! Check notes above on configurations.
"clean:fontAsana",
"clean:fontGyrePagella",
"clean:fontGyreTermes",
"clean:fontLatinModern",
"clean:fontNeoEuler",
"clean:fontStix",
"clean:fontStixWeb",
//"clean:fontTeX",
// Font formats. Pick at least one (unless you use SVG output; then clean all).
//"clean:dropFonts", // when using SVG output
"clean:eot",
"clean:otf",
"clean:png",
"clean:svg",
//"clean:woff",
// Input. Pick at least one.
"clean:asciimathInput",
"clean:mathmlInput",
//"clean:texInput",
// Output
//"clean:htmlCssOutput",
"clean:mathmlOutput",
"clean:svgOutput",
// Extensions. You probably want to leave the set matching your choices.
"clean:extensionsAsciimath",
"clean:extensionsMathml",
//"clean:extensionsTeX",
//"clean:extensionHtmlCss",
// Other items
"clean:locales",
"clean:miscConfig",
// "clean:miscExtensions", // you probably want that
"clean:images",
"clean:notcode"
]);
// then run grunt job
grunt template
// clean up
rm -rf node_modules
rm Gruntfile.js
rm package-lock.jsonhttps://stackoverflow.com/questions/39448548
复制相似问题