GitbookIO / plugin-mathjax

MathJAX plugin for GitBook
Apache License 2.0
89 stars 53 forks source link

Can't use two formula on single line #10

Open jtrussell opened 9 years ago

jtrussell commented 9 years ago

First, thanks for the awesome plugin!

When I have a line that contains just a single formula it gets centered with padded with vertical padding as expected. The problem I have is when I want to start and end a line with a formula, something like:

$$formula$$ text $$formula$$

This gets rendered as a single formula, the two inner-most delimiters getting interpreted as part of a larger formula, here's a screenshot:

screen shot 2015-02-08 at 6 31 34 pm

Am I doing something wrong?

jtrussell commented 9 years ago

Just FYI I can definitely use \text{...} as a workaround.

SamyPesse commented 9 years ago

What version of gitbook are you using ? the 2.0.0-alpha ?

jtrussell commented 9 years ago

gitbook@1.5.0 gitbook-plugin-mathjax@0.0.6

CHN-beta commented 5 years ago

Same issue. Seems Mathjax handled the text in middle as the formula. image What I configured more is that I added a script in head, to enable Mathjax works on inline formula with single $ around.

<script type="text/x-mathjax-config;executed=true">
        MathJax.Hub.Config({
            tex2jax: {
                inlineMath: [ ['$','$'] ],
                processEscapes: true
            }
        });
    </script>

The example is here: https://catalog.chn.moe/%E6%96%87%E7%AB%A0/%E4%BD%9C%E4%B8%9A/%E7%BB%9F%E8%AE%A1%E7%89%A9%E7%90%86%E7%A0%94%E8%AE%A8/%E5%B8%83%E6%9C%97%E8%BF%90%E5%8A%A8.html Markdown source code is here:

其中,$x'_\text{new}$、$p'_\text{new}$ 的定义为:

But, sometimes, that's OK to write two formula in a single line, as in the same example above: image

CHN-beta commented 5 years ago

I've found that it's caused by the pair of _. So, how to told gitbook do not translate underscores? I use * but never use _ to show italic.

CHN-beta commented 5 years ago

I've solved the problem by modifying the code. If you face the same issue, use

"plugins": [
    "mathjax@git+https://github.com/CHN-beta/plugin-mathjax.git#update_cdn"
],