我在Rstudio中使用rmarkdown尝试使用Rstudio提供的示例代码编写PDF(下面的代码):
---
title: "Untitled"
output:
pdf_document:
keep_tex: yes
---
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.
When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
```{r}
summary(cars)
```
You can also embed plots, for example:
```{r, echo=FALSE}
plot(cars)
```
Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.
但是,我收到以下错误:
! pdfTeX错误(字体扩展):只有可扩展的自动扩展 字体。 \ AtBegShi @ Output ... ipout \ box \ AtBeginShipoutBox \ fi \ fi l.144 \ end {document}
pandoc.exe:从TeX源生成PDF时出错 错误:pandoc文档转换失败,错误43 另外:警告信息: 运行命令&#34;&#34; C:/ Program Files / RStudio / bin / pandoc / pandoc&#34; + RTS -K512m -RTS test_rmarkdown.utf8.md - 来自latexdown + autolink_bare_uris + ascii_identifiers + tex_math_single_backslash-implicit_figures --output test_rmarkdown.pdf --template&#34; C:\ Users \ XXXX \ Documents \ R \赢得库\ 3.2 \ rmarkdown \ RMD \胶乳\ default.tex&#34; - 高亮式探戈--latex-engine pdflatex - 变量&#34;几何:margin = 1in&#34;&#39;状态为43执行暂停
我的会话信息如下所示:
> sessionInfo()
R version 3.2.2 (2015-08-14)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] Rcpp_0.11.6 digest_0.6.8 MASS_7.3-43 grid_3.2.2 plyr_1.8.2 gtable_0.1.2 magrittr_1.5 scales_0.2.4
[9] ggplot2_1.0.1 stringi_0.4-1 reshape2_1.4.1 rmarkdown_0.8 proto_0.3-10 tools_3.2.2 stringr_1.0.0 munsell_0.4.2
[17] yaml_2.1.13 colorspace_1.2-6 htmltools_0.2.6
我正在运行完整的TeXworks版本0.4.6 64位。
答案 0 :(得分:0)
devtools::install_github("rstudio/rmarkdown")
这对我有用。
如果你没有devtools,你需要运行它:
install.packages("devtools")
library(devtools).