Huxpro / huxpro.github.io

My Blog / Jekyll Themes / PWA
http://huangxuan.me
Apache License 2.0
7.11k stars 5.5k forks source link

Mathjax display mode not working #378

Open Olafyii opened 4 years ago

Olafyii commented 4 years ago

image -> image

mathjax_support.html:

<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    TeX: {
      equationNumbers: {
        autoNumber: "AMS"
      }
    },
    SVG: {
      scale: 90
    },
    tex2jax: {
      inlineMath: [ ['$','$'] ],
      displayMath: [ ['$$','$$'], ['[[', ']]'] ],
      processEscapes: true,
    }
  });
</script>
<script type="text/javascript"
        src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>

Why is the double dollar delimiter not working?

Huxpro commented 4 years ago

@Olafyii

Did you turn on the Latex support via mathjax: true as mentioned in the https://github.com/Huxpro/huxpro.github.io/blob/master/_doc/Manual.md#posts?

Olafyii commented 4 years ago

@Huxpro Yes, and the inline mode is working fine. The display mode also works if the delimiter is not ['$$','$$'], for example ['[[',']]']. But if I use '\$$' as delimiter, it works. image Line 1, 3, and 4 works just fine. Seems that the '$$' delimiter won't invoke mathjax, and will change to '\(' in HTML...

roife commented 4 years ago

I cannot have $$ work as well. But $ works.

jinyiliu commented 4 years ago

我也有一样的问题,本地预览的时候,用 Chrome 是可以正常显示公式的,但是 Safari 显示有问题,所有 $$ 都变成 \] ,但是 $ 是没有问题的。然而 push 之后 Chrome 也不能正常显示了,Chrome 和 Safari 都只有 $ 能显示。最近才出现的问题,以前没遇到过。

mikelyou commented 4 years ago

Same problem here. My formulas that were good in the past now don't show correctly. $xx$ still works, but $$xxx$$ is broken. Maybe it's due to the version upgrading of mathjax, I guess?

zwt0204 commented 4 years ago

@jinyiliu 参考https://github.com/fancyerii/fancyerii.github.io/blob/master/_includes/mathjax.html 已解决

jinyiliu commented 4 years ago

@zwt0204 谢谢,问题解决了!但是 \boldsymbol 的显示好像有点问题,不知道有没有其他人遇到过,这样就无法加粗希腊字母了。下面是 \boldsymbol{F}=m\boldsymbol{a}=m\frac{\mathrm{d}^2\boldsymbol{x}}{\mathrm{d}t^2} 显示的结果,看起来根本没有加粗,就是变得更斜了。

截屏2020-10-16 下午5 58 16
simplestory commented 3 years ago

我更换为下面这个,可以解决,各字符进行各种操作都显示正常

<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    tex2jax: {
      inlineMath: [['$','$'], ['\\(','\\)']],
      processEscapes: true,
    }
  });
</script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-MML-AM_CHTML' async></script>
selchwang commented 3 years ago

$xx$ and $$xx$$ works well with this config

// _includes/mathjax_support.html
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    tex2jax: {
      inlineMath: [ ['$','$'], ['\\(','\\)'] ],
      processEscapes: true
    }
  });
</script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS_HTML' async></script>
Yingfan-Duan commented 2 years ago

我更换为下面这个,可以解决,各字符进行各种操作都显示正常

<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    tex2jax: {
      inlineMath: [['$','$'], ['\\(','\\)']],
      processEscapes: true,
    }
  });
</script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-MML-AM_CHTML' async></script>

This approach solved my problem as well! Thx