小编chr*_*iss的帖子

如何通过 Pandoc 和 Knit 从 Rmarkdown 访问 MathJax 扩展(如 siunitx)?

使用Rmarkdownin Rstudio、 usingpandocknitr,我的目标是通过 LaTeX 输出 PDF 和使用 .html 输出 HTML MathJax。我想使用一些MathJax可用的扩展,以便为 PDF 目标提供更丰富的 LaTeX。siunitx具体来说,我现在正在尝试使用该扩展,尽管我也对其他扩展感兴趣(例如physics)。

使用siunitxLaTeX 进行 PDF 输出效果很好,但我很难让它与 HTML 输出一起工作。

这是一个 Rmarkdown 文件示例:

---
title: "siunitx test"
author: "chriss"
date: "June 13, 2017"
output:
  html_document:
    mathjax: https://cdn.rawgit.com/mathjax/MathJax/2.7.1/latest.js?config=TeX-AMS-MML_HTMLorMML
    number_sections: yes
  pdf_document:
    keep_tex: yes
    latex_engine: xelatex
    number_sections: yes
header-includes: \usepackage{siunitx}
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

# The Problem

I would like to be …
Run Code Online (Sandbox Code Playgroud)

mathjax pandoc rstudio knitr r-markdown

6
推荐指数
1
解决办法
2067
查看次数

标签 统计

knitr ×1

mathjax ×1

pandoc ×1

r-markdown ×1

rstudio ×1