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

Can't use two formula on single line #10

Open
jtrussell opened this issue Feb 8, 2015 · 6 comments
Open

Can't use two formula on single line #10

jtrussell opened this issue Feb 8, 2015 · 6 comments

Comments

@jtrussell
Copy link

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
Copy link
Author

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

@SamyPesse
Copy link
Member

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

@jtrussell
Copy link
Author

@CHN-beta
Copy link

CHN-beta commented Apr 15, 2019

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
Copy link

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
Copy link

CHN-beta commented Apr 15, 2019

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"
], 

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

3 participants