Skip to content
This repository has been archived by the owner on Nov 24, 2020. It is now read-only.

Maths Plugin Improvement Suggestion #5

Open
ErnWong opened this issue Aug 25, 2014 · 14 comments
Open

Maths Plugin Improvement Suggestion #5

ErnWong opened this issue Aug 25, 2014 · 14 comments

Comments

@ErnWong
Copy link

ErnWong commented Aug 25, 2014

Right now, I think Mathematics is displayed like this:

What's happening now

(correct me if I'm wrong...)

Suggestion: Would it be great if it was like this?

Suggestion?

  • ASCIIMath, TeX syntax, and MathML are all recognised and parsed (authors can choose which one to use through the plugin options).
  • Various delimiters for mathematics are recognised and supported (chosen by the author through plugin options, maybe author uses a lot of dollar signs? perhaps.)
  • MathML and SVG are generated. Since MathJax is not lightning fast, SVG is shown until all mathematics are typeset completely.
    SVG is also used as a backup for software that don't support MathML nor MathJax. SVG can be disabled through the option.
    Perhaps something like MathJax-Node could help us with generating MathML and SVG?
  • Authors can define custom macros for MathJax through the plugin options. This would make our lives a lot easier and make our markdown source look more beautiful (and readable).
  • Original notation source is preserved in MathML annotation.
  • MathJax is served with the webpage, so that mathematics is rendered consistently. (Authors can also choose the maths font settings and other useful settings as well)

Summary

What do you guys, @SamyPesse and @AaronO, think?


Plugin options that are possibly great to have:

  • choose input notation
  • choose maths delimiters
  • enable/disable SVG being generated
  • custom macros and all those kind of good stuff that are in MathJax configurations.
@pkra
Copy link

pkra commented Aug 25, 2014

👍 we're happy to help with any MathJax and MathJax-node questions.

@renkun-ken
Copy link

Since commit eafa018 disabled inline math, I'm wondering how I can use inline math if there's a need? Now my inline formulas don't render any more...

@ErnWong
Copy link
Author

ErnWong commented Sep 10, 2014

I think right now double dollar signs e.g. $$ 1+1=2 $$ are parsed for inline... I'm not sure if that will change later on though.

Escaping the TeX notation still works though, although it's not parsed by kramed:
e.g. \\( 1+1=2 \\) compiles to \( 1+1=2 \) which MathJax then reads.

However, that means that you will have to escape a lot of characters in your maths formulae, like ampersands, slashes, etc. and you could run into problems like #3

@renkun-ken
Copy link

Thanks @ErnWong, I reviewed the official documentation at http://docs.mathjax.org/en/latest/start.html#tex-and-latex-input, tried and it works only for inline math, and still found no way to render displayed math.

Commit eafa018 removes the inlineMath config, so everything should go back to the default settings of mathjax, that is,

The default math delimiters are $$...$$ and \[...\] for displayed mathematics, and \(...\) for in-line mathematics.

Why $$...$$ (displayed math) is rendered as inline math instead?

@renkun-ken
Copy link

Find a way to use both inline math and displayed math:

Inline math:

This is an equation $$x^2+y^2=z^2$$ where $$x$$, $$y$$, and $$z$$ are some variables.

Displayed math:

This is an equation 
$$x^2+y^2=z^2$$ 
where $$x$$, $$y$$, and $$z$$ are some variables.

(just start a new line to write displayed math)

This works for me :)

@ErnWong
Copy link
Author

ErnWong commented Sep 10, 2014

Also, \\[ x=0 \\] works as well (at least last time I tried it).

But then that skips kramed preprocessing, meaning that markdown vs maths issues like #3 will creep back.

By the way, although the double dollar signs for both inline and display works, it sacrifices the ability to write display maths within paragraphs. I guess you don't need that though, and $$ does makes the code look clearer.

But then... GitbookIO/kramed#3

@renkun-ken
Copy link

Thanks @ErnWong for the references to the previous issues! It seems like the decision must be made really carefully to meet so many demands :) At the moment I'll change my content to adopt $$ in all places, hope it won't be broken some time later...

@reudhos
Copy link

reudhos commented Feb 12, 2015

Is it possible to add mhchem extension to MathJax. I really need it for the chemistry book. In mathjax configuration docs the recommendation is to "use this extension in your own configurations, add it to the extensions array in the TeX block:
TeX: {
extensions: ["mhchem.js"]
}"

But if try to do it in book.json it just doesn't work.

@hardywu
Copy link

hardywu commented Feb 26, 2015

Let single dollar sign be supported as inline math delimiter? This could enable converting existing latex files into gitbooks.

@cben
Copy link

cben commented Mar 10, 2015

@vasalx It should also be possible to force the extension to load by putting \require{mhchem} in some equation.
http://docs.mathjax.org/en/latest/tex.html#tex-and-latex-extensions

@davy39
Copy link

davy39 commented Nov 20, 2015

Thanks @ErnWong for this great summary of expected improvements, it 's very clearly exposed !
Does anybody currently working on it ? I'll be happy to help :)

Especially, I will be glad to be able to use another input notation (ASCIIMath).
What about simply using config=TeX-MML-AM_HTMLorMML ?

Isn't it possible to enable a full configuration of mathjax by linking some MathJax.Hub.Config parameters to book.json "pluginsConfig" ?

@dsoto
Copy link

dsoto commented Dec 9, 2015

+1 for single dollar sign delimiter for maximum compatibility with existing latex

@vkrishna143
Copy link

As @dsoto said it would be great to have compatibility with existing latex

@xiaopow
Copy link

xiaopow commented Jan 14, 2017

for block math

$$ a + b $$

for inline math

$$a + b$$

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants