我想做以下工作
---
title: "Untitled"
author: "SQC"
date: "21 September 2018"
output: html_document
---
\newcommand{\short}{AreallylongwordIhavetotypefrequently}
# My Test
I would like to write \short which does not work, $\short$ however is close...
Snippets do not work in Rmd plain text (= Rstudio's "Shift", see link below).
但是我找不到解决方案。如果周围有东西,那就太好了!
以下链接是有用的,但没有提出解决方案:pandoc doc,\newcommand in Rmd formula和RStudio snippets。
最佳答案
如何使用R代替:
---
title: "Untitled"
author: "SQC"
date: "21 September 2018"
output: html_document
---
```{r, include = FALSE}
short <- "AreallylongwordIhavetotypefrequently"
```
# My Test
I would like to write `r short` instead ...
关于latex - 如何在Rmd中使用Latex的\newcommand?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/52438607/