Jot eN
Jot eN

Reputation: 6396

How can I write a degree symbol in RMarkdown 2?

I'm writing some code with descriptions using Rmarkdown 2 and knit PDF.

I've been trying many method to write a degree symbol inline:

And many possible RMarkdown symbols, such as:

But nothing is working. Is there a way to write a degree symbol in RMarkdown 2 and convert it do PDF?

EDIT (18 AUGUST 2014):

Ok, I found out where is the problem. If you use \circ in normal sentence or first-level list it is ok. But when I try to use \circ in second-level list - it's not working.

enter image description here

Upvotes: 6

Views: 10456

Answers (3)

Jot eN
Jot eN

Reputation: 6396

The problem was with RMarkdown converting nested lists. On this page http://rmarkdown.rstudio.com/authoring_pandoc_markdown.html you can find sentence:

The nested list must be indented four spaces or one tab

Although, using the tab could be a problem. When using four spaces - it works:

* Let's turn this round 360$^\circ$
    + Let's turn this round 360$^\circ$ 

enter image description here

Upvotes: 10

Spacedman
Spacedman

Reputation: 94182

Using \circ works for me, RStudio, knit to pdf:

Let's turn this round 360$^\circ$

degree symbol

Upvotes: 1

jaybee
jaybee

Reputation: 955

You can use plotmath's degree, e.g.

plot(1, xlab=expression(4*degree))

Upvotes: 0

Related Questions