我正在实现一个看起来非常像math.stackexchange.com上的UI:
$... 之间使用MathJax解析公式$.所以我下载了PageDown演示并进行了设置,效果非常好.现在我尝试在每次<textarea>更改时动态加载MathJax .
MathJax得到了这种方法的一个例子,但我无法让它运行.这就是'my'代码的样子:
<link rel="stylesheet" type="text/css" href="demo.css" />
<script type="text/javascript" src="../../Markdown.Converter.js"></script>
<script type="text/javascript" src="../../Markdown.Sanitizer.js"></script>
<script type="text/javascript" src="../../Markdown.Editor.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.js"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {
inlineMath: [["$","$"],["\\(","\\)"]]
}
});
$("#wmd-input").keypress(function(event){
UpdateMath($(this).val());
});
</script>
<script type="text/javascript" src="../../../mathjax-MathJax-07669ac/MathJax.js?config=TeX-AMS_HTML-full">
</script>
</head>
<body>
<script>
(function () {
var QUEUE = MathJax.Hub.queue; // shorthand for the queue
var math = null; // the element jax for the math …Run Code Online (Sandbox Code Playgroud) 使用Sublime Text 3,我正在写一个包含数学的Markdown文档.Markdown预览包允许在浏览器(Chrome)中实时呈现文档.因此,在我写作时,更改是可见的.以下是我的降价文字.
$a = \sin^{2}(\Delta \phi/2) + \cos(\phi_{1})\cos(\phi_{2})\sin^{2}(\Delta \lambda/2)$
$c = 2 \arcsin(\sqrt{a})$
$d = rc$
Run Code Online (Sandbox Code Playgroud)
MarkdownPreview手册说像"当enable_mathjax为true",但我无法弄清楚它在哪里.为完整起见,Sublime控制台不显示任何错误消息.我正在使用Windows 7和从Git获取的最新MathJax.当我显示一些示例测试html时,MathJax本身工作正常.