Hi Mattia,

On Sun, May 22, 2016 at 12:42:32PM +0000, Mattia Rizzolo wrote:
> > MathJax.Hub.Config({
> >   config: ["MML_SVG.js"],
> >   extensions: ["MatchWebFonts.js"],
> >   MathML: { extensions: ["mml3.js"] },
> >   SVG: { blacker: 1 },
> > });
>
> This is apparently not right (as in: the test document is not displayed
> as it should).
> So, I went looking for mathjax docs <http://docs.mathjax.org/> on a
> tentative to forge configuration that would work, but I totally failed
> on the process (all the trials failed).
>
> Would you be willing to help me figure out what are the right options
> for this?
>
> Also FTR, the patch i cooked is this (+ rm+ln)
>
> --- a/src/MainUI/PreviewWindow.cpp
> +++ b/src/MainUI/PreviewWindow.cpp
> @@ -213,6 +213,14 @@
>          int endheadpos = text.indexOf("</head>");
>          if (endheadpos > 1) {
>              QString inject_mathjax = 
> +              "<script type=\"text/x-mathjax-config\">"
> +              " MathJax.Hub.Config({"
> +              "  config: [\"MML_SVG.js\"],"
> +              "  extensions: [\"MatchWebFonts.js\"],"
> +              "  MathML: { extensions: [\"mml3.js\"] },"
> +              "  SVG: { blacker: 1 },"
> +              " });"
> +              "</script>"
>                "<script type=\"text/javascript\" "
>                "src=\"" + mathjaxurl + "\"></script>";
>              text.insert(endheadpos, inject_mathjax);

I could not figure out how to test it with Sigil, but your patch looks correct
to me, and works fine on a simple test MathML document in a QWebView.

I think the wrong part here is rm+ln (sorry that I advised you to do it).

Please try setting mathjaxurl (in the code above) to
"file:///usr/share/javascript/mathjax/MathJax.js", instead of symlinking.

--
Dmitry Shachnev

Attachment: signature.asc
Description: PGP signature

Reply via email to