如何使数学块内的液体逸出内容

问题描述 投票:0回答:1

我正在将Jekyll与Kramdown和MathJax一起使用。在我的降价促销中,即使数学块由$$双元分隔,我也得到了液体解析错误

.....
$$
a = \begin{bmatrix}
a_{1}\\a_{2}\\a_{3}\ 
\end{bmatrix} = \begin{bmatrix} a_{1} & a_{2} &a_{3}\end{bmatrix}
 \vec a = \left\langle {{a_1},{a_2},{a_3}} \right\rangle ---> Line 35
$$
....

错误

home/alex/gems/gems/liquid-4.0.0/lib/liquid/block_body.rb:132:in `raise_missing_variable_terminator': Liquid syntax error (line 35): Variable '{{a_1}' was not properly terminated with regexp: /\\}\\}/ (Liquid::SyntaxError)

The Jekyll _config.yaml

# Markdown specs
markdown: kramdown
mathjax: true

kramdown:
  auto_ids:       true
  footnote_nr:    1
  entity_output:  as_char
  footnote_backlink: "↩︎"
  toc_levels:     1..6
  smart_quotes:   lsquo,rsquo,ldquo,rdquo
  enable_coderay: false
liquid mathjax kramdown
1个回答
0
投票

似乎无法通过HTTP从Github加载Mathjax.js。所以我们需要使用HTTPS

如果使用Jekyll,请将其添加到_layouts文件夹中的default.html中

<script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script>

并且如果您使用单美元$进行内联数学,则可以将以下内容添加到head.html的布局中

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

https://github.com/alexcpn/alexcpn.github.io/tree/master/_layouts

© www.soinside.com 2019 - 2024. All rights reserved.