Jekyll支持markdown分析器,可以很好地与mathjax配合使用吗? [英] Is there a markdown parser supported on Jekyll that plays nicely with mathjax?

查看:151
本文介绍了Jekyll支持markdown分析器,可以很好地与mathjax配合使用吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用基于Jekyll的博客,并且需要一个markdown解析器,它不会打断我的Mathjax表达式(例如,将 b_t - b_ {t-1} 解释为 b< em> t - b< / em> t - 1 )。 Mathjax和markdown在math.stackechange.com和mathoverflow.net上相处得很好。一些解析器还需要将开始/结束方程符号 \\()加倍转义,而其他人则不需要。



不完全的解决方案:

Redcarpet2 可以选择 no_intra_emphasis ,这样可以避免字母之间的下划线被破坏,所以 b_t 可以,但它仍然会破坏 b_ {t-1}



有一个Jekyll插件它允许您使用液体语法,如 {%m}%开始一个等式,但这意味着该文件不再以纯降价编写,因此不能移植到其他上下文。

那么是否有不同的降价解释器可以放入Jekyll并体验幸福?如果不是,其他人找到的解决方法是什么?

解决方案

Markdown不会处理块级HTML标记中的任何内容,因此只需简单地将Mathja无论解释器如何,< div> < / div> 都保护Mathjax语法。这很好地避免了必须转义开始和结束Mathjax的命令,例如 \((inline)和 \ [(display)。感谢Github上的 @lsegal 指出这一点。


I use a Jekyll based blog and need a markdown parser that won't clobber my Mathjax expressions (for instance, interpreting b_t - b_{t-1} as b<em>t - b</em> t - 1). Mathjax and markdown get along nicely over on math.stackechange.com and mathoverflow.net. Some parsers also need to double escape the begin/end equation symbols \\(, while it seems others do not.

Things that aren't quite solutions:

Redcarpet2 has an option for no_intra_emphasis, which avoids underscores between letters being clobbered, so b_t is okay, but it still clobbers b_{t-1}.

There's a Jekyll plugin that lets you use liquid syntax, like {% m}% to begin an equation, but this means the file is no longer written in pure markdown and thus not portable to other contexts.

So is there a different markdown interpreter I can drop into Jekyll and experience bliss? If not, what workarounds have others found?

解决方案

Markdown won't process anything in block-level HTML tag, so simply wrapping Mathjax syntax in <div> </div> protects the Mathjax syntax, regardless of the interpreter. This nicely avoids having to escape the commands that begin and end the Mathjax, such as \( (inline) and \[ (display). Thanks to @lsegal on Github for pointing this out to me.

这篇关于Jekyll支持markdown分析器,可以很好地与mathjax配合使用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆