Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I write a degree symbol in rmarkdown2 for HTML and PDF output?

Tags:

I want to write a degree symbol in an rmarkdown file that is rendered correctly both for HTML and PDF output. A regular ° works for HTML, and a $^\circ$ works for the PDF - but what works for both cases?

like image 364
daniel Avatar asked Oct 07 '14 10:10

daniel


People also ask

How do you make a degree symbol in markdown?

$$ \textdegree $$ or $\textdegree$

How do I encode a degree symbol?

The keyboard shortcut for the degree symbol is Alt + 0176. To type the degree symbol using your Windows computer keyboard, hold down the Alt key and then type 0176 on the number pad (located at the rightmost portion of the keyboard).

How do you write degrees in latex?

to your preamble, that should enable the command. Another alternative is the \textdegree command, which is provided by the textcomp package. And, finally, $^{\circ}$ is another way of obtaining roughly the right symbol.


1 Answers

Use ° i.e. 75°F turns into 75°F in both HTML and PDF outputs.

like image 63
hrbrmstr Avatar answered Sep 28 '22 02:09

hrbrmstr