Options

XyJax diagram plugin for MathJax

edited July 2015 in Azimuth Forum

XyJax (aka xypic.js) is a MathJax extension that implements a large part of the XyPic LaTeX diagram package. Given the interest in networks and categories on Azimuth, it would be worthwhile enabling it on the forum and/or blog.

Comments

  • 1.
    edited September 2015

    here is a test example:

    $$ \begin{xy} \xymatrix { {\mathscr{C}} & a \ar[r]^f \ar[dr]{g \circ f} & b \ar[d]^g & \ar@{~>}[r]^F & & Fa \ar[r]^{Ff} \ar[dr]*[l]{\scriptstyle F(g\circ f) = Fg\circ Ff} & Fb \ar[d]^{Fg} & {\mathscr{D}} \ && c & \ar@{~>}[r]^F &&& Fc } \end{xy} $$ it should render like http://mhlr.github.io/test.html

    Comment Source:here is a test example: $$ \begin{xy} \xymatrix { {\mathscr{C}} & a \ar[r]^f \ar[dr]{g \circ f} & b \ar[d]^g & \ar@{~>}[r]^F & & Fa \ar[r]^{Ff} \ar[dr]*[l]{\scriptstyle F(g\circ f) = Fg\circ Ff} & Fb \ar[d]^{Fg} & {\mathscr{D}} \ && c & \ar@{~>}[r]^F &&& Fc } \end{xy} $$ it should render like http://mhlr.github.io/test.html
  • 2.
    edited July 2015

    The easiest way to enable XyJax would be through the MathJax 3rd party repository


    From https://github.com/mathjax/MathJax-third-party-extensions

    Using third party extensions.

    We host copy of the third-party extension repository on the MathJax CDN. This means anything you contribute here will be easily available to all MathJax CDN users.

    To add the third party repository to your configuration use

    <script type="text/x-mathjax-config">
      MathJax.Ajax.config.path["Contrib"] = "//cdn.mathjax.org/mathjax/contrib";
    </script>
    

    or equivalently,

    <script type="text/javascript">
      window.MathJax = {
        AuthorInit: function () {
                MathJax.Ajax.config.path["Contrib"] = "//cdn.mathjax.org/mathjax/contrib";
            }
      };
    </script>
    

    in your configuration. See also the documentation page on third party extensions and this repository.


    From https://github.com/mathjax/MathJax-third-party-extensions/tree/master/xyjax

    Using the MathJax CDN

    The MathJax CDN hosts a copy of this single-file version of XyJax via the MathJax third party extension repository. To use the CDN copy, you need MathJax v2.4 (or higher) and configure the third party extension repository as described in the MathJax documentation.

    Then add the XyJax extension to your configuration like any other third party extension from the MathJax CDN. For example, your inline configuration might be

     <script type="text/x-mathjax-config>
     MathJax.Hub.Config({
       extensions: ["tex2jax.js","[Contrib]/xyjax.js"],
       jax: ["input/TeX","output/HTML-CSS"],
       tex2jax: {inlineMath: [["$","$"],["\\(","\\)"]]},
       TeX: {extensions: ["AMSmath.js","AMSsymbols.js"]}
     });
     </script>
    
    Comment Source:The easiest way to enable XyJax would be through the MathJax 3rd party repository ---- # From https://github.com/mathjax/MathJax-third-party-extensions ## Using third party extensions. We host copy of the third-party extension repository on the MathJax CDN. This means anything you contribute here will be easily available to all MathJax CDN users. To add the third party repository to your configuration use <script type="text/x-mathjax-config"> MathJax.Ajax.config.path["Contrib"] = "//cdn.mathjax.org/mathjax/contrib"; </script> or equivalently, <script type="text/javascript"> window.MathJax = { AuthorInit: function () { MathJax.Ajax.config.path["Contrib"] = "//cdn.mathjax.org/mathjax/contrib"; } }; </script> in your configuration. See also the [documentation page on third party extensions and this repository](http://docs.mathjax.org/en/latest/options/ThirdParty.html#mathjax-third-party-extension-repository). ---- # From https://github.com/mathjax/MathJax-third-party-extensions/tree/master/xyjax ## Using the MathJax CDN {#CDN} The MathJax CDN hosts a copy of this single-file version of XyJax via the [MathJax third party extension repository](https://github.com/mathjax/MathJax-third-party-extensions). To use the CDN copy, you need MathJax v2.4 (or higher) and configure the third party extension repository as described in the [MathJax documentation](http://docs.mathjax.org/). Then add the XyJax extension to your configuration like any other third party extension from the MathJax CDN. For example, your inline configuration might be <script type="text/x-mathjax-config> MathJax.Hub.Config({ extensions: ["tex2jax.js","[Contrib]/xyjax.js"], jax: ["input/TeX","output/HTML-CSS"], tex2jax: {inlineMath: [["$","$"],["\\(","\\)"]]}, TeX: {extensions: ["AMSmath.js","AMSsymbols.js"]} }); </script>
Sign In or Register to comment.