本文介绍了R Markdown 与“newcommand"类似的功能;在乳胶?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
R Markdown 是否具有与 LaTex 的newcommand"类似的构造?我希望能够将 var
之类的东西定义为 mathrm{Var}
以避免在数学模式下额外输入.如果没有,人们如何减少markdown中排版方程式的重复?
Does R Markdown have a similar construct to LaTex's "newcommand"? I would like to be able to define things like var
to be mathrm{Var}
to avoid the extra typing in math mode. If not, what do people do to reduce repetition in typesetting equations in markdown?
推荐答案
像在 LaTeX 中一样使用 ewcommand{var}{mathrm{Var}}
:
Use ewcommand{var}{mathrm{Var}}
exactly like you would in LaTeX:
---
title: "Untitled"
author: "An Author"
date: "January 15, 2017"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
ewcommand{var}{mathrm{Var}}
## R Markdown
This is an R Markdown document. $var+2$ Markdown is a simple formatting syntax for
authoring HTML, PDF, and MS Word documents. For more details on using R Markdown
see <http://rmarkdown.rstudio.com>.
请注意,为了在输出中正确处理它,您必须使用 $
...$
.
Note that in order for it to be processed correctly in the output, you'll have to use $
...$
.
这篇关于R Markdown 与“newcommand"类似的功能;在乳胶?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!