有没有办法在README中渲染LaTex ?md在GitHub存储库?我在谷歌上搜索了堆栈溢出,但没有一个相关的答案似乎可行。
当前回答
我一直在四处寻找,发现另一个问题中的这个答案最适合我。即使用githubcontent数学渲染器,例如显示:
使用这个链接 小心乳胶需要url编码,但其他工作对我来说很好。
其他回答
对于简短的表达式和不那么花哨的数学,您可以使用内联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下一种方式:



好消息! 根据这篇博文,现在GitHub在自述文件中支持Mathjax。
可以使用$分隔符使用内联LaTeX语法,或者使用$$分隔符使用块内语法。
你也可以使用这个在线编辑器:https://www.codecogs.com/latex/eqneditor.php,它可以动态生成SVG文件。你可以像这样在你的文档中添加一个链接: ,结果是: .
你可以用markdown,例如:
=\beta_0&space;+&space;\beta_1&space;x&space;+&space;u)
代码可以在这里输入:https://www.codecogs.com/latex/eqneditor.php。
我测试了其他人提出的一些解决方案,我想推荐TeXify在agurodriguez的评论中创建和提出,并由Tom Hale进一步描述-我想发展他的答案,并给出一些理由,为什么这是一个非常好的解决方案:
TeXify is wrapper of Readme2Tex (mention in Lee answer). To use Readme2Tex you must install a lot of software in your local machine (python, latex, ...) - but TeXify is github plugin so you don't need to install anything in your local machine - you only need to online installation that plugin in you github account by pressing one button and choose repositories for which TeXify will have read/write access to parse your tex formulas and generate pictures. When in your repository you create or update *.tex.md file, the TeXify will detect changes and generate *.md file where latex formulas will be exchanged by its pictures saved in tex directory in your repo. So if you create README.tex.md file then TeXify will generate README.md with pictures instead tex formulas. So parsing tex formulas and generate documentation is done automagically on each commit&push :) Because all your formulas are changed into pictures in tex directory and README.md file use links to that pictures, you can even uninstall TeXify and all your old documentation will still works :). The tex directory and *.tex.md files will stay on repository so you have access to your original latex formulas and pictures (you can also safely store in tex directory your other documentation pictures "made by hand" - TeXify will not touch them). You can use equations latex syntax directly in README.tex.md file (without loosing .md markdown syntax) which is very handy. Julii in his answer proposed to use special links (with formulas) to external service e.g . http://latex.codecogs.com/gif.latex?s%3D%5Ctext%20%7B%20sensor%20reading%20%7D which is good however has some drawbacks: the formulas in links are not easy (handy) to read and update, and if there will be some problem with that third-party service your old documentation will stop work... In TeXify your old documentation will works always even if you uninstall that plugin (because all your pictures generated from latex formulas are stay in repo in tex directory). The Yuchao Jiang in his answer, proposed to use Jupyter Notebook which is also nice however have som drawbacks: you cannot use formulas directly in README.md file, you need to make link there to other file *.ipynb in your repo which contains latex (MathJax) formulas. The file *.ipynb format is JSON which is not handy to maintain (e.g. Gist don't show detailed error with line number in *.ipynb file when you forgot to put comma in proper place...).
这里是我的一些回购的链接,我使用TeXify的文档是从README.tex.md文件生成的。
更新
今天2020.12.13我意识到TeXify插件停止工作-即使重新安装后:(
推荐文章
- 我如何确定文件编码在OS X?
- 如何运行一个github-actions步骤,即使前一步失败,同时仍然失败的工作
- 当我试图推到原点时,为什么Git告诉我“没有这样的远程‘原点’”?
- 在GitHub repo上显示Jenkins构建的当前状态
- 如何取消在github上的拉请求?
- HEAD和master的区别
- 在另一个目录中运行操作
- GitHub克隆与OAuth访问令牌
- 我可以在GitHub上对要点进行拉请求吗?
- Git:在推送后删除提交的文件
- 在GitHub中编辑git提交消息
- Github:导入上游分支到fork
- GitHub上的分叉和克隆有什么区别?
- 在LaTeX中突出显示源代码
- 如何将现有的解决方案从Visual Studio 2013添加到GitHub