如何在一般的github的markdown中显示数学方程(而不是github的博客) [英] How to show math equations in general github's markdown(not github's blog)

查看:845
本文介绍了如何在一般的github的markdown中显示数学方程(而不是github的博客)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我调查之后,我发现mathjax可以做到这一点。但是,当我在减价文件中写一些例子时,它不能显示正确的方程:

我在减价文件的头部添加了这个:

 < script type =text / javascriptsrc =http://cdn.mathjax.org/mathjax/latest/MathJax.js?配置=默认>< /脚本> 

然后键入mathjax语句:

(E = mc ^ 2),$$ x_ {1,2} = \ frac {-b \ pm \sqrt {b ^ 2-4ac}} {2b}。$$



但github没有显示数学符号!请帮助我,谢谢!
告诉我如何在一般的github markdown中显示数学符号。

解决方案


但github数学符号什么都不显示!请帮助我,谢谢!


GitHub降价解析由 SunDown (例如libUpSkirt)库。

库的座右铭是符合标准,快速, 安全 标记在C中的处理库。重要的词是安全在那里,考虑你的问题:)。



事实上,允许执行javascript将与MarkDown标准文本到HTML合约有点相似。



此外,所有看起来像HTML标签的内容都会被转义或剥离。


告诉我如何显示数学符号


最好的办法是找到一个类似于 yuml.me ,它可以通过解析提供的URL查询字符串来生成即时图像。 b
$ b

更新



我发现有些网站为用户提供这种服务: codedogs.com 不再支持嵌入)或 iTex2Img
您可能想尝试一下。当然,其他人可能存在,并且一些Google-fu可以帮助您找到它们。



给出以下标记语法

  [方程](http://www.sciweavers.org/tex2img.php?eq=1%2Bsin%28mc%5E2%29&bc=White&fc=Black&!; im = jpg& fs = 12& ff = arev& edit =)



equation http://www.sciweavers.org/tex2img.php?eq=1%2Bsin%28mc%5E2% 29& bc = White& fc =黑色& im = jpg& fs = 12& ff = arev& edit =

注意:为了正确显示图像,您必须确保URL的查询字符串部分 编码百分比 。您可以轻松找到在线工具来帮助您完成该任务,例如 www.url-encode -decode.com


After my investigating, I found mathjax can do this. But when write some example in my markdown file, it can't show the correct equations:

I have added this in the head of markdown file:

<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=default"></script>

And type the mathjax statement:

(E=mc^2),$$x_{1,2} = \frac{-b \pm \sqrt{b^2-4ac}}{2b}.$$

But github show nothing for the math symbols! please help me, thanks! Tell me how to show math symbols in general github markdown.

解决方案

But github show nothing for the math symbols! please help me, thanks!

GitHub markdown parsing is performed by the SunDown (ex libUpSkirt) library.

The motto of the library is "Standards compliant, fast, secure markdown processing library in C". The important word being "secure" there, considering your question :).

Indeed, allowing javascript to be executed would be a bit off of the MarkDown standard text-to-HTML contract.

Moreover, everything that looks like a HTML tag is either escaped or stripped out.

Tell me how to show math symbols in general github markdown.

Your best bet would be to find a website similar to yuml.me which can generate on-the-fly images from by parsing the provided URL querystring.

Update

I've found some sites providing users with such service: codedogs.com (no longer seems to support embedding) or iTex2Img. You may want to try them out. Of course, others may exist and some Google-fu will help you find them.

given the following markdown syntax

![equation](http://www.sciweavers.org/tex2img.php?eq=1%2Bsin%28mc%5E2%29&bc=White&fc=Black&im=jpg&fs=12&ff=arev&edit=)

it will display the following image

equation http://www.sciweavers.org/tex2img.php?eq=1%2Bsin%28mc%5E2%29&bc=White&fc=Black&im=jpg&fs=12&ff=arev&edit=

Note: In order for the image to be properly displayed, you'll have to ensure the querystring part of the url is percent encoded. You can easily find online tools to help you with that task, such as www.url-encode-decode.com

这篇关于如何在一般的github的markdown中显示数学方程(而不是github的博客)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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