phillord / mathjax-latex

Wordpress Plugin for MathJax mathematics renderer
GNU General Public License v2.0
57 stars 12 forks source link

not working when the equation is too long or too complicated #28

Open Sunethan opened 6 years ago

Sunethan commented 6 years ago

I found that MathJax won't work well when the equation is too many "A_{1}^{2}", "\text{1233}" or something like that. For example,

$$\large\sum_{i=1}^n\vec{F}_{\text{ext, i}}=\sum_{i=1}^n$$

This equation won't show LaTeX correctly.

However, if I delete =\sum_{i=1}^n, then everything is fine.

$$\large\sum_{i=1}^n\vec{F}_{\text{ext, i}}$$

I really need your help. I love this plugin so much because it enables me to write a physics blog. Thank you so much.

You can see this two pictures :

https://imgur.com/Myse5vr

https://imgur.com/a/IxXI7

paulschreiber commented 6 years ago

This is working for me. Post body:

[mathjax]

$$\large\sum_{i=1}^n\vec{F}_{\text{ext, i}}$$

$$\large\sum_{i=1}^n\vec{F}_{\text{ext, i}}=\sum_{i=1}^n$$

Rendering:

screenshot 2018-02-17 14 35 05

Please provide more details. You state that the longer equation won't "show LaTeX correctly," but don't state in what ways it is shown incorrectly. Do you see no equation? Or the wrong equation? Are there any errors in the console?

Sunethan commented 6 years ago

Thanks for replying. You can see this image to know the way it's shown incorrectly.

2018-02-19 11 29 35

And its MathJax-latex plugin code is this :

2018-02-19 11 29 50

paulschreiber commented 6 years ago

Are you seeing any errors in the console?

What are your settings on the MathJax-LaTeX settings page? Mine are:

Sunethan commented 6 years ago

Sorry for replying late. I'm a little bit busy these days. Thanks for your help ><.

This is my Mathjax setting

2018-03-14 9 06 57

Besides, I add some code before in the header.php

<!--MathJax --> 
<script src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML' type='text/javascript'>
    MathJax.Hub.Config({  
     TeX: { equationNumbers: { autoNumber: "AMS" } },  
     tex2jax: {  
      inlineMath: [ ['$','$'], ["\\(","\\)"] ],  
      displayMath: [ ['$$','$$'], ["\\[","\\]"] ],  
      processEscapes: true },  
     'HTML-CSS': { scale: 130 },  
     displayIndent: '2em'  
    });
</script>
<!--End MathJax -->

2018-03-14 9 08 21

I'm not sure if the CDN link is correct. It's my friend who help me to add this code. That enables me to use $..$ in inline mode. I've tried to delete this code to see whether everything is well. However, after I delete it and use [mathjax], some mathjax code still doesn't work. By the way, if I use too complicated latex code in inline mode, then something wrong also happens, like $E_{\text{mechanical}}$. it won't show correctly.

Thank you so much.

Sunethan commented 6 years ago

The error is :

2018-03-14 11 05 20

LaTeX Code: $$\large\sum_{i=1}^n\vec{F}_{\text{ext, i}}=\sum_{i=1}^n$$

It renders like the html code: $$\large\sum_{i=1}^n\vec{F}<em>{\text{ext, i}}=\sum</em>{i=1}^n$$