如何在RMarkdown 2中编写学位符号?

时间:2014-08-17 20:02:20

标签: r pdf latex knitr r-markdown

我正在使用Rmarkdown 2和knit PDF编写一些包含描述的代码。

我一直在尝试很多方法来内联写一个度数符号:

  • Latex包:siunitx的\ ang
  • Latex包:textcomp的\ textdegree
  • Latex:\ circ

许多可能的RMarkdown符号,例如:

  • $$ \ textdegree $$或$ \ textdegree $

但没有任何效果。有没有办法在RMarkdown 2中编写学位符号并将其转换为PDF?

编辑(2014年8月18日):

好的,我发现了问题所在。如果您在正常句子或第一级列表中使用\ circ,则可以。但是当我尝试在二级列表中使用\ circ时 - 它不起作用。

enter image description here

3 个答案:

答案 0 :(得分:8)

问题在于RMarkdown转换嵌套列表。在此页http://rmarkdown.rstudio.com/authoring_pandoc_markdown.html上,您可以找到句子:

  

嵌套列表必须缩进四个空格或一个标签

虽然使用标签可能是个问题。当使用四个空格时 - 它可以工作:

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

enter image description here

答案 1 :(得分:1)

使用\ circ为我工作,RStudio,编织为pdf:

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

degree symbol

答案 2 :(得分:0)

您可以使用plotmath的{​​{1}},例如

degree