使用Rmarkdownin Rstudio、 usingpandoc和knitr,我的目标是通过 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)