Giter Site home page Giter Site logo

Math formula support ? about mdbook HOT 4 CLOSED

rust-lang avatar rust-lang commented on September 3, 2024
Math formula support ?

from mdbook.

Comments (4)

azerupi avatar azerupi commented on September 3, 2024

I would love that too ;) Actually that is one of the features I want most, because I plan to use mdBook for my school notes. But the best place to implement this is in the markdown parser (pulldown-cmark). There is already a request there, but it's not very active.

from mdbook.

azerupi avatar azerupi commented on September 3, 2024

I added the MathJax JS files (from the CDN) you can already add math equations but sometimes it collides with the markdown rules, for example:
*$$ 1 * 2 + 3 = 5 $$ works but *$$1*2+3=5$$ does not.

from mdbook.

waynenilsen avatar waynenilsen commented on September 3, 2024

Yea, I agree that it should be in the markdown parser. As a workaround you could sanitize the MD by replacing the math with random, non-repeating characters a-z and keeping a lookup table, then putting the math back into the generated HTML. Maybe there is an easier way?

from mdbook.

azerupi avatar azerupi commented on September 3, 2024

At the moment, it should work using:

Blocks

\\[ Your math here... \\]

Inline

\\( Your math here... \\)

You have to double-escape, because the markdown parser is going to remove one backslash. I have used this and I haven't had any problems. The dollar signs do not work well and would need support in the markdown parser.

from mdbook.

Related Issues (20)

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.