有没有办法在README中渲染LaTex ?md在GitHub存储库?我在谷歌上搜索了堆栈溢出,但没有一个相关的答案似乎可行。


当前回答

对于简短的表达式和不那么花哨的数学,您可以使用内联HTML在codecogs上获得乳胶渲染的数学,然后嵌入生成的图像。这里有一个例子:

- <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 " />

这会导致类似下一次的事情吗

更新:这是伟大的工作在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%20is%20observed%20at%20a%20time%20bin%20%7D%20t)

其他回答

我一直在四处寻找,发现另一个问题中的这个答案最适合我。即使用githubcontent数学渲染器,例如显示:

使用这个链接 小心乳胶需要url编码,但其他工作对我来说很好。

我的诀窍是用木星笔记本。

GitHub内置了呈现.ipynb文件的支持。你可以编写内联的LaTeX代码并在笔记本中显示,GitHub会为你呈现它。

下面是一个示例笔记本文件:https://gist.github.com/cyhsutw/d5983d166fb70ff651f027b2aa56ee4e

对于简短的表达式和不那么花哨的数学,您可以使用内联HTML在codecogs上获得乳胶渲染的数学,然后嵌入生成的图像。这里有一个例子:

- <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 " />

这会导致类似下一次的事情吗

更新:这是伟大的工作在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%20is%20observed%20at%20a%20time%20bin%20%7D%20t)

你可以用markdown,例如:

![equ](https://latex.codecogs.com/gif.latex?log(y)=\beta_0&space;&plus;&space;\beta_1&space;x&space;&plus;&space;u)

代码可以在这里输入:https://www.codecogs.com/latex/eqneditor.php。

如果你对https://www.codecogs.com/latex/eqneditor.php有问题,我发现https://alexanderrodin.com/github-latex-markdown/对我有用。它生成您需要的Markdown代码,因此您只需将其剪切并粘贴到README中。md文档。