hyphen in RMarkdown

Viewed 307

Hello I'm quite new to using Rmarkdown and using Latex in genral.

I would like to use a hyphen with in a formula in a Rmarkdown html reprot.

This is my code:

---
pagetitle: "Home"
author: "R lumpe"
date: "`r format(Sys.Date(),'%d.%m.%Y')`"
output:
  html_document:
    df_print: paged
  word_document: default
  pdf_document: default
keep_md: yes
---

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

$$\frac{variable-name}{other-variable-name}$$

But in the document I only recive a "long" Minus sign and not a - "short" hyphen

Thanks for you help.

1 Answers

Change to text mode using \text

$$\frac{variable\text-name}{other\text-variable\text-name}$$

Related