Coder Social home page Coder Social logo

pandoc-tex2svg's People

Contributors

jgm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pandoc-tex2svg's Issues

tex2svg was not found in Path on Windows machine

I am running pandoc 2.1.1 and have installed mathjax-node and the pandoc-tex2svg filter.

I have also installed mathjax-node-cli and have tex2svg available from my Path. It is located here:

/c/Users/~/AppData/Roaming/npm/tex2svg

When running the pandoc command

pandoc math-samples.md --filter pandoc-tex2svg -s -t html5 -o math-samples2.html

I get the following error:

The tex2svg program was not found in the path.
Install MathJax-node (https://github.com/mathjax/MathJax-node)
and ensure that tex2svg is in your path.
Error running filter pandoc-tex2svg:
Filter returned error status 1

tex2svg no longer in Mathjax-node

Hello!

A search does not return anything: see here. Is there a workaround?

EDIT: It seems that a tex2svg executable is available here, and it seems to work. :)

Thank you for the nice script!

Non-dollar Math supported by MathJax is not processed by MathJax-node

Markdown:

\begin{equation}
E = mc^2
\end{equation}

\begin{equation}
E = pc
\end{equation}

Command:

pandoc --mathjax -F pandoc-tex2svg

The resultant HTML is untouched by MathJax-node.

And by the way, the same test can be used to test AMS equation numbering. Because it is rendered by mj-single.js, I expect it not able to increment the numbering. I'm not sure what's the solution though (besides using mj-page.js which is supposed to work on HTML5 output. But obviously the one need this most is ePub output. I'm now thinking if it is possible to throw in the whole HTML file before combining it to ePub. However, I don't know the pandoc ePub build process so I don't know if it is possible.) I should have thought about this point before suggesting passing each equation to tex2svg rather than page2svg. I thought this is more robust, but now we lost AMS-numbering... Sorry!

Emit more helpful error message?

I tried running it on a large file (book-size), and there's a lot of error message, a sample is like this:

Error: TypeError: math.replace is not a function
    at StartQueue (/usr/local/lib/node_modules/mathjax-node/lib/mj-single.js:668:17)
    at Function.execute (file:///usr/local/lib/node_modules/mathjax-node/node_modules/mathjax/unpacked/MathJax.js:243:26)
    at cb (file:///usr/local/lib/node_modules/mathjax-node/node_modules/mathjax/unpacked/MathJax.js:225:59)
    at Object.Process (file:///usr/local/lib/node_modules/mathjax-node/node_modules/mathjax/unpacked/MathJax.js:495:38)
    at Object.call (file:///usr/local/lib/node_modules/mathjax-node/node_modules/mathjax/unpacked/MathJax.js:508:37)
    at Function.WAITEXECUTE (file:///usr/local/lib/node_modules/mathjax-node/node_modules/mathjax/unpacked/MathJax.js:348:50)
    at cb (file:///usr/local/lib/node_modules/mathjax-node/node_modules/mathjax/unpacked/MathJax.js:225:59)
    at Object.Process (file:///usr/local/lib/node_modules/mathjax-node/node_modules/mathjax/unpacked/MathJax.js:495:38)
    at Object.call (file:///usr/local/lib/node_modules/mathjax-node/node_modules/mathjax/unpacked/MathJax.js:508:37)
    at Function.WAITEXECUTE (file:///usr/local/lib/node_modules/mathjax-node/node_modules/mathjax/unpacked/MathJax.js:348:50)

Probably it is some syntax it is complaining about (I also configure the MathJax manually), but unlike MathJax that will show the wrong syntax in red, MathJax-node will just choke and complain. So it would be helpful by showing some error message. Perhaps if there's an error, print the Math sent into MathJax-node?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.