Ionic2 使用mathjax grunt cleaner减少mathjax大小

Ionic2 使用mathjax grunt cleaner减少mathjax大小,ionic2,mathjax,Ionic2,Mathjax,我正在尝试将mathjax运行到我的ionic2应用程序中。有人能告诉我如何使用mathjax grunt cleaner缩小mathjax的尺寸吗 到目前为止,我已经使用NPM+donwload mathjax latest+从github下载mathjax grunt cleaner安装了grunt 之后需要帮助。我需要MathJax用于我的Ionic 2应用程序,我遵循了与您相同的过程(grunt cleaner)。您可以下载调整大小的mathjax文件夹 要将其包括在项目中,请执行以下操

我正在尝试将mathjax运行到我的ionic2应用程序中。有人能告诉我如何使用mathjax grunt cleaner缩小mathjax的尺寸吗

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


之后需要帮助。

我需要MathJax用于我的Ionic 2应用程序,我遵循了与您相同的过程(grunt cleaner)。您可以下载调整大小的mathjax文件夹 要将其包括在项目中,请执行以下操作:

  • 将提取的文件夹放入
    www
    文件夹中
  • 在src/index.html中,将其放入
    head
    部分:

  • 
    MathJax.Hub.Config({tex2jax:{inlineMath:[[['$','$$'],['$','$'],['\(','\')']});
    
    我需要MathJax来开发我的Ionic 2应用程序,我遵循了与您所遵循的相同的过程(grunt cleaner)。您可以下载调整大小的mathjax文件夹 要将其包括在项目中,请执行以下操作:

  • 将提取的文件夹放入
    www
    文件夹中
  • 在src/index.html中,将其放入
    head
    部分:

  • 
    MathJax.Hub.Config({tex2jax:{inlineMath:[[['$','$$'],['$','$'],['\(','\')']});
    
    我不是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.json
    

    我不是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.json
    

    您可能想提供更多关于您尝试了什么的信息。我承认我的grunt知识有点贫乏,并且假设你对grunt有一点了解,但不清楚你在哪里有问题。我的grunt知识是非常-2的基础水平。我只想在Ionic2项目中使用小尺寸的mathjax设置。如果你能帮助我。我不知道如何在CLI中运行MathJax grunt cleaner。您可以通过
    grunt TASKNAME
    运行grunt任务。文件中有几个示例grunt任务,如果这些任务不适合,那么您必须编写自己的任务。决定保留哪些部分需要对MathJax有很好的了解,更重要的是要知道应用程序需要MathJax的哪些部分——最后一部分通常是主要的困难,但恐怕只有你自己能知道。你可能想提供更多关于你尝试了什么的信息。我承认我的grunt知识有点贫乏,并且假设你对grunt有一点了解,但不清楚你在哪里有问题。我的grunt知识是非常-2的基础水平。我只想在Ionic2项目中使用小尺寸的mathjax设置。如果你能帮助我。我不知道如何在CLI中运行MathJax grunt cleaner。您可以通过
    grunt TASKNAME
    运行grunt任务。文件中有几个示例grunt任务,如果这些任务不适合,那么您必须编写自己的任务。决定保留哪些部分需要对MathJax有很好的了解,更重要的是要知道应用程序需要MathJax的哪些部分——最后一部分通常是主要的困难,但恐怕只有您才能知道。