1
RstudioのRmarkdownからPDFドキュメントを作成しようとしているうちに、しばらくの間苦労しました。私の目標は、 "Journal of Statistical Software"フォーマットを作成することです。サンプルスクリプトを実行すると、エラーが発生します。PDFから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から直接これを行う方法を知っていれば、それは私が考えると最も簡単な解決策になります。
ありがとうございます!
https://miktex.org/downloadの下であなたが見つけることができるmiktexを使用することができます。 Windowsではmiktexを使用することができます。https://miktex.org/download – Wolfgang
新しいRmdファイルにコピーして貼り付けるときに同じエラーが表示されますが、RStudioダイアログボックスを使用してテンプレートを開いても問題ありません。バグ、そうだね。 – alistaire
これは@ウォルフガングがなぜ過去にはうまくいかなかったのか分かりませんでしたが、今すぐPDFを作成することに興奮しました!ありがとう –