2017-03-20 2 views
1

저는 Rstudio의 Rmarkdown에서 PDF 문서를 만들려고 몇 시간 동안 곤경에 처했습니다. 내 목표는 "Journal of Statistical Software"형식을 만드는 것이며 제공된 예제 스크립트를 실행하면 오류가 발생합니다.PDF Docs from RMarkdown

스크립트 :

--- 
author: 
    - name: FirstName LastName 
    affiliation: University/Company 
    address: > 
     First line 
     Second line 
    email: [email protected] 
    url: http://rstudio.com 
    - name: Second Author 
    affiliation: Affiliation 
title: 
    formatted: "A Capitalized Title: Something about a Package \\pkg{foo}" 
    # If you use tex in the formatted title, also supply version without 
    plain:  "A Capitalized Title: Something about a Package foo" 
    # For running headers, if needed 
    short:  "\\pkg{foo}: A Capitalized Title" 
abstract: > 
    The abstract of the article. 
keywords: 
    # at least one keyword must be supplied 
    formatted: [keywords, not capitalized, "\\proglang{Java}"] 
    plain:  [keywords, not capitalized, Java] 
preamble: > 
    \usepackage{amsmath} 
output: rticles::jss_article 
--- 

# Introduction 

This template demonstrates some of the basic latex you'll need to know to create a JSS article. 

## Code formatting 

Don't use markdown, instead use the more precise latex commands: 

* \proglang{Java} 
* \pkg{plyr} 
* \code{print("abc")} 

# R code 

Can be inserted in regular R markdown blocks. 

```{r} 
x <- 1:10 
x 
``` 

이 내 오류를하고 있습니다 :

pandoc.exe: pdflatex not found. pdflatex is needed for pdf output. 
Error: pandoc document conversion failed with error 41 
In addition: Warning message: 
running command '"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS Untitled.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output Untitled.pdf --template "C:\Users\OPTIMA~1\DOCUME~1\R\WIN-LI~1\3.3\rticles\RMARKD~1\TEMPLA~1\JSS_AR~1\RESOUR~1\template.tex" --highlight-style tango --latex-engine pdflatex' had status 41 
Execution halted 

나는 그것을 다운로드 MikTex과 관련이있다 알지만 쉬운 단계를별로 찾을 수 없어 RStudio에서 RMarkdown의 PDF 문서를 실행하기 위해 이것을 다운로드하는 방법.

도움이 될 것입니다. 웹에서 무언가를 다운로드하는 대신 R에서이 작업을 직접 수행하는 방법을 알고 있다면 가장 쉬운 해결책이 될 것입니다.

감사합니다.

+0

https://miktex.org/download에서 찾을 수 있습니다 miktex를 사용할 수 있습니다. Windows에서 miktex를 사용할 수 있습니다. https://miktex.org/download – Wolfgang

+0

복사하여 새로운 Rmd 파일에 붙여 넣을 때 동일한 오류가 발생하지만 RStudio 대화 상자를 사용하여 템플릿을 잘게 썬다. 벌레, 내 생각 엔. – alistaire

+0

그 것이 왜 @Wolfgang에서 효과가 있었는지 모르지만 과거에는 효과가 없었지만 지금은 PDF를 만들기 시작했습니다. 감사합니다 –

답변

2

pandoc은 pdflatex를 사용하여 pdf 출력을 생성하므로 반드시 설치해야합니다.

윈도우에서 당신은 pandoc PDF 파일을 만들 수 pdflatex을 필요로

관련 문제