Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to type tilde in formulas in RMarkdown

I am trying to type equations on RMarkdown to create a PDF and I want to use a tilde, how can I go about it. I am trying this but throws back a pandoc.exe: Error producing PDF from TeX source ....

---
title: "See"
date: "24 September 2016"
output: html_document
---

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

follows a Bernouli distribution 
$$y_i \~ Bernouli(p_i)$$
like image 549
Keniajin Avatar asked Sep 24 '16 01:09

Keniajin


People also ask

How do I type a tilde in markdown?

Depending on your Markdown processor or editor, you'll use three backticks ( ``` ) or three tildes ( ~~~ ) on the lines before and after the code block.

How do you type a tilde in R studio?

AltGr + ^ will give you a tilde ~~~~ on a Linux system with an Italian keyboard, which is what you said you were using in the comments. Show activity on this post. You could use this variable when you need tilde in text. Alternately, you could just type tilde and copy and paste the character.

How do I type math symbols in R markdown?

Math inside RMarkdownIn side a text chunk, you can use mathematical notation if you surround it by dollar signs $ for “inline mathematics” and $$ for “displayed equations”. Do not leave a space between the $ and your mathematical notation. Example: $\sum_{n=1}^{10} n^2$ is rendered as ∑10n=1n2.

How do you type Greek letters in R markdown?

To make a Greek letter in R, You just use \ and then the name of the letter. If you want a subscript, like β1 , you use $\beta_1$ .


1 Answers

I believe if you do

$$
\sim
$$

This should produce the ~ you are attempting to place in your formula.

like image 190
Hansel Palencia Avatar answered Oct 13 '22 01:10

Hansel Palencia