【问题标题】:How to knit a greek symbol in R-studio to generate a pdf如何在 R-studio 中编织希腊符号以生成 pdf
【发布时间】:2015-01-13 14:27:19
【问题描述】:

我正在使用 R studio markdown 和 knitr,这些都是很棒的东西。

我似乎无法将希腊符号编织成 pdf。

相同的 Rmd 文件:

---
title: "Untitled"
author: "Hugo Koopmans"
date: "11-01-2015"
output: pdf_document
---


Test Greek symbol
----------------

P-value
In statistics, the p-value is a function of the observed sample results (a statistic) that is used for testing a statistical hypothesis. Before performing the test a threshold value is chosen, called the significance level of the test, traditionally 5% or 1% [1] and denoted as α. If the p-value is equal or smaller than the significance level (\alpha)

现在我在 linx mint 17 texlive 2013 Rstudio 版本 0.98.1062

结果:

  |.................................................................| 100%
  ordinary text without R code


/usr/lib/rstudio/bin/pandoc/pandoc Preview-25df24aa1731.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash-implicit_figures --output Preview-25df24aa1731.pdf --template /home/hugo/R/x86_64-pc-linux-gnu-library/3.0/rmarkdown/rmd/latex/default.tex --highlight-style tango --latex-engine pdflatex --variable 'geometry:margin=1in' 


processing file: Preview-25df24aa1731.Rmd
output file: Preview-25df24aa1731.knit.md

! Package inputenc Error: Unicode char \u8:α not set up for use with LaTeX.

See the inputenc package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.73 denoted as α

Try running pandoc with --latex-engine=xelatex.
pandoc: Error producing PDF from TeX source
Error: pandoc document conversion failed with error 43
Execution halted

结果是 pandoc 抱怨 alpha 符号。所以生成的latex好像不能处理符号...

我想让 R studio 正确处理这个问题,而无需手动更改 tex 文件...理想情况下...

有什么建议吗?

雨果

【问题讨论】:

    标签: r pdf-generation knitr pandoc tex


    【解决方案1】:

    对于 Rmarkdown 中的希腊符号,您可以使用内联公式,由 $ ... $ 表示,即两个 $ 符号。

    试试这个:

    If the p-value is equal or smaller than the significance level $\alpha$

    【讨论】:

      猜你喜欢
      • 2019-12-24
      • 2015-04-04
      • 2023-04-06
      • 2017-02-17
      • 2017-04-23
      • 2018-09-05
      • 2011-07-14
      • 1970-01-01
      • 2020-05-10
      相关资源
      最近更新 更多