首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用mathjax -grunt cleaner减小mathjax大小

使用mathjax -grunt cleaner减小mathjax大小
EN

Stack Overflow用户
提问于 2016-09-12 18:44:47
回答 2查看 301关注 0票数 1

我正在尝试在我的ionic2应用程序中运行mathjax。谁能告诉我如何使用mathjax -grunt cleaner来减小mathjax的大小?

到目前为止,我已经使用NPM + donwload mathjax latest +从github下载MathJax- grunt cleaner安装了grunt。

在那之后需要帮助。

EN

回答 2

Stack Overflow用户

发布于 2017-01-14 04:29:42

我需要为我的Ionic2应用程序使用MathJax,并且我遵循了与您所遵循的相同的步骤(grunt-cleaner)。您可以下载调整大小的mathjax文件夹here以将其包含在您的项目中:

  1. 将解压缩的文件夹放在www文件夹中。
  2. 在src/index.html文件中将其放入Index.html。

代码语言:javascript
复制
 <script type="text/x-mathjax-config">
  MathJax.Hub.Config({tex2jax: {inlineMath: [['$$','$$'],['$','$'], ['\(','\)']]}});
</script>

  <script type="text/javascript" src="mathjax/MathJax.js?config=default">
  </script>
票数 1
EN

Stack Overflow用户

发布于 2020-06-18 16:08:21

我不是Grunt或MatJax的专家,但它对我很有效

代码语言:javascript
复制
// 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.json
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39448548

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档