Mat*_*ice 4 rstudio knitr r-markdown
我在RStudio的.rmd中创建了一个技术报告,其中有很多数学表达式.使用编织到HTML,它工作得很好.由于html文件在GitHub存储库上无法很好地呈现,我将.rmd输出更改为github_document(.md)文件.但是,当我将文件上传到GitHub时,我发现公式无法正确显示.它们采用乳胶脚本格式.
我想知道哪个是将渲染的.rmd文件(在RStudio中)上传到GitHub存储库的有效策略?(不是GitHub页面).
谢谢.
Pandoc支持在Markdown文件中转换数学,以便通过--webtex参数在GitHub上显示.只需在Rmd前导码中添加必要的参数,RMarkdown就会将参数传递给Pandoc:
---
title: "My Title"
output:
github_document:
pandoc_args: --webtex
---
# R Markdown Document
Maths expression embedded in GitHub Markdown:
$$
E = \frac{mc^2}{\sqrt{1-\frac{v^2}{c^2}}}
$$
with some more inline Latex $\gamma$, $\lambda$, $\theta$
Run Code Online (Sandbox Code Playgroud)
呈现文档时,中间的Latex块将呈现为https://latex.codecogs.com/并自动嵌入到文档中.
此功能已在Pandoc 2.0.4中添加,因此请确保您的版本足够新.
由于输出只是嵌入式Web链接,因此输出显示在SO以及任何其他markdown支持的站点上:
嵌入在GitHub Markdown中的数学表达式:
一些更内联的乳胶
,
,
| 归档时间: |
|
| 查看次数: |
952 次 |
| 最近记录: |