Github 上 README.md 中的乳胶渲染 [英] Latex rendering in README.md on Github

查看:26
本文介绍了Github 上 README.md 中的乳胶渲染的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在 GitHub 存储库中的 README.md 中呈现 LaTex?我用谷歌搜索并搜索了堆栈溢出,但相关答案似乎都不可行.

Is there any way to render LaTex in README.md in a GitHub repository? I've googled it and searched on stack overflow but none of the related answers seems feasible.

推荐答案

对于简短的表达式和不太花哨的数学,您可以使用内联 HTML 在 codecogs 上获取乳胶渲染的数学,然后嵌入生成的图像.举个例子:

For short expresions and not so fancy math you could use the inline HTML to get your latex rendered math on codecogs and then embed the resulting image. Here an example:

- <img src="https://latex.codecogs.com/gif.latex?O_t=	ext { Onset event at time bin } t " /> 
- <img src="https://latex.codecogs.com/gif.latex?s=	ext { sensor reading }  " /> 
- <img src="https://latex.codecogs.com/gif.latex?P(s | O_t )=	ext { Probability of a sensor reading value when sleep onset is observed at a time bin } t " />

这应该会导致类似下一个

Which should result in something like the next

更新:这在 Eclipse 中效果很好,但不幸的是在 github 中效果不佳.唯一的解决方法是下一个:

Update: This works great in eclipse but not in github unfortunately. The only work around is the next:

获取您的乳胶方程式并转到 http://www.codecogs.com/latex/eqneditor.php,在您的方程式显示区域的底部有一个小下拉菜单,选择 URL 编码,然后通过以下方式将其粘贴到您的 github markdown 中:

Take your latex equation and go to http://www.codecogs.com/latex/eqneditor.php, at the bottom of the area where your equation appears displayed there is a tiny dropdown menu, pick URL encoded and then paste that in your github markdown in the next way:

![equation](http://latex.codecogs.com/gif.latex?O_t%3D%5Ctext%20%7B%20Onset%20event%20at%20time%20bin%20%7D%20t)
![equation](http://latex.codecogs.com/gif.latex?s%3D%5Ctext%20%7B%20sensor%20reading%20%7D) 
![equation](http://latex.codecogs.com/gif.latex?P%28s%20%7C%20O_t%20%29%3D%5Ctext%20%7B%20Probability%20of%20a%20sensor%20reading%20value%20when%20sleep%20onset%20is%20observed%20at%20a%20time%20bin%20%7D%20t)

这篇关于Github 上 README.md 中的乳胶渲染的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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