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

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

问题描述

有没有办法在GitHub仓库中的README.md中渲染LaTex?我搜索了它并搜索了堆栈溢出,但没有一个相关的答案似乎是可行的。 解决方案

花哨的数学,你可以使用内联的HTML来让你的胶乳在codecog上渲染数学,然后嵌入结果图像。这里有一个例子:

   - < img src =https://latex.codecogs.com/gif.latex?O_t = \text {在时间点开始事件} t/> 
- < img src =https://latex.codecogs.com/gif.latex?s=\text {sensor reading}/>
- < img src =https://latex.codecogs.com/gif.latex?P(s | O_t)= \text {一旦观察到睡眠开始时传感器读数值的可能性bin} t/>

这应该会导致下一个类似的问题。









更新:这在eclipse中效果很好,但不幸在github中。唯一的解决方法是下一步:

把你的乳胶方程式转到 http://www.codecogs.com/latex/eqneditor.php ,在公式出现的区域底部显示一个小小的下拉菜单,选择URL编码,然后粘贴到你的github markdown中:

 ![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%图20是%20observed%20AT%20A%20time%20bin%20%7D% 20t)


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.

解决方案

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

Which should result in something like the next

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

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天全站免登陆