【问题标题】:How can I write a degree symbol in RMarkdown 2?如何在 RMarkdown 2 中编写学位符号?
【发布时间】:2014-10-10 18:22:41
【问题描述】:

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

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

  • 乳胶包装:siunitx's \ang
  • 乳胶包:textcomp 的 \textdegree
  • 乳胶:\circ

还有很多可能的RMarkdown符号,比如:

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

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

编辑(2014 年 8 月 18 日):

好的,我发现问题出在哪里。如果您在普通句子或一级列表中使用 \circ 就可以了。但是当我尝试在二级列表中使用 \circ - 它不起作用。

【问题讨论】:

  • 你在谷歌上搜索过乳胶学位吗?
  • 是的,当然 - 我在那里找到了 \textdegree 或 \circ 选项;但它不适用于内联 RMarkdown2 -> PDF 文件
  • 永远不要说“它不适合我”。说它是如何不工作的。错误信息?完全没有符号?符号在错误的地方?另外,请包括您的非工作来源。
  • Spacedman,你当然是对的。我已经包含了一些解释。
  • 第二级列表是用打字机字体排版的——即使你没有一些$stuff$,它是如何做到的?我将不得不查看中间的 TeX 文件以确切了解它在做什么......

标签: r pdf latex knitr r-markdown


【解决方案1】:

问题在于 RMarkdown 转换嵌套列表。在这个页面http://rmarkdown.rstudio.com/authoring_pandoc_markdown.html你可以找到一句话:

嵌套列表必须缩进四个空格或一个制表符

虽然,使用标签可能是个问题。使用四个空格时 - 它有效:

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

【讨论】:

    【解决方案2】:

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

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

    【讨论】:

      【解决方案3】:

      你可以使用plotmathdegree,例如

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

      【讨论】:

        猜你喜欢
        • 2019-03-27
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-05-13
        相关资源
        最近更新 更多