rstudio / rmarkdown

Dynamic Documents for R
https://rmarkdown.rstudio.com
GNU General Public License v3.0
2.88k stars 974 forks source link

Error when Knitting: --latex-engine has been removed. #1183

Closed dylanjm closed 7 years ago

dylanjm commented 7 years ago

Hello, I'm getting an error when trying to knit a document.

processing file: wsj_07.Rmd
output file: wsj_07.knit.md

/usr/local/bin/pandoc +RTS -K512m -RTS wsj_07.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output wsj_07.pdf --template /usr/local/lib/R/3.4/site-library/rmarkdown/rmd/latex/default-1.17.0.2.tex --highlight-style tango --latex-engine /Library/TeX/texbin/pdflatex --variable graphics=yes --variable 'geometry:margin=1in' 
--latex-engine has been removed.  Use --pdf-engine instead.
Try pandoc --help for more information.
Error: pandoc document conversion failed with error 2
Execution halted

At first I thought it might have been an issue with the Template Package I've been developing but this error is now also showing up on a vanilla pdf .RMD file. This error did not start happening until I updated & upgraded homebrew this evening.

Edit:

I see you guys are aware of this issue as of the most recent Pandoc Update. Will leave this here in case anything has changed since those posts.

yihui commented 7 years ago

~Yes, two other users have reported this issue. I'll investigate it tomorrow and see if the Pandoc bug https://github.com/jgm/pandoc/issues/2618 is back again. Thanks!~

yihui commented 7 years ago

Oops just read your error message, and this issue actually has been solved. Please do

devtools::install_github("rstudio/rmarkdown")
dylanjm commented 7 years ago

@yihui installed the github version of markdown and am now getting this error:

output file: homework_18.knit.md

/usr/local/bin/pandoc +RTS -K512m -RTS homework_18.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output homework_18.pdf --template /usr/local/lib/R/3.4/site-library/HomeworkBYUI/rmarkdown/templates/homework/resources/homework_template.tex --highlight-style tango --pdf-engine /Library/TeX/texbin/pdflatex 
pdf-engine /Library/TeX/texbin/pdflatex is not compatible with output format latex
Error: pandoc document conversion failed with error 1
Execution halted

Running on a vanilla .RMD file, with no changes to the YAML

yihui commented 7 years ago

That was reported at https://github.com/rstudio/rmarkdown/issues/1120#issuecomment-340574769 and I'll investigate it soon.

yihui commented 7 years ago

This issue should be resolved now. Again:

devtools::install_github("rstudio/rmarkdown")

This should work with Pandoc 2.0. Thanks for the testing!

saakira commented 6 years ago

@yihui I am having the same problem. I ran devtools::install_github("rstudio/rmarkdown") but the error was not resolved. The version of pandoc is 2.0.4. The following error is displayed when pdf is generated.

latex-engine has been removed. Use --pdf-engine instead. Try pandoc --help for more information

OS is using windows10.

yihui commented 6 years ago

@saakira Please describe your "problem" in more detail. What exactly did you do?

saakira commented 6 years ago

@yihui Thank you for your reply.

I installed tex live 2017 and pandoc 2.0.4 and passed the environment path, so I tried to generate pdf file from md file. Although it was possible with the previous version of pandoc, it can not be done after updating the version. The latex engine specifies latex_engine: lualatex

yihui commented 6 years ago

so I tried to generate pdf file from md file

How exactly did you try? What exactly was the md file? Please describe it to the extent that I can follow your steps to reproduce your issue. Most importantly, have you verified your rmarkdown version?

devtools::session_info('rmarkdown')
saakira commented 6 years ago

An error will occur when converting md file generated using knitr package from R-studio to pdf file. I installed the package with devtools::install_github("rstudio/rmarkdown"), but it was not resolved. Since the md file is generated, it is presumed that the process of converting to pdf may be a problem.

Executed devtools::session_info('rmarkdown').

version R version 3.3.2 (2016-10-31) system x86_64, mingw32
ui RStudio (1.1.383)
rmarkdown 1.8.3 2017-12-06 Github (rstudio/rmarkdown@07f7d8e)

saakira commented 6 years ago

In windows 8.1 I installed a version of pandoc that generated PDF, but it was not created in windows 10. It may be an OS problem.

saakira commented 6 years ago

I solved using old version of pandoc.@yihui Thank you for your response!

cimentadaj commented 6 years ago

This error persists in Windows 10. I tried all nearly all of the pandoc versions from 2.0 to 2.1.3 and the error persists.

output file: test.knit.md --latex-engine has been removed. Use --pdf-engine instead. Try pandoc.exe --help for more information. Error: pandoc document conversion failed with error 2 In addition: Warning message: running command '"C:/Users/CIMENT~1/AppData/Local/Pandoc/pandoc" +RTS -K512m -RTS test.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output test.pdf --template "C:\Users\cimentadaj\Desktop\Documents\all_repos\phd_thesis\packrat\lib\x86_64-w64-mingw32\3.4.4\rmarkdown\rmd\latex\default-1.17.0.2.tex" --highlight-style tango --latex-engine pdflatex --variable graphics=yes --variable "geometry:margin=1in"' had status 2 Execution halted

Session info ------------------------------------------------------------------------------------------
 setting  value                       
 version  R version 3.4.4 (2018-03-15)
 system   x86_64, mingw32             
 ui       RStudio (1.2.432)           
 language (EN)                        
 collate  English_United States.1252  
 tz       Europe/Paris                
 date     2018-03-21                  

Packages ----------------------------------------------------------------------------------------------
 package   * version date       source                          
 base      * 3.4.4   2018-03-15 local                           
 compiler    3.4.4   2018-03-15 local                           
 datasets  * 3.4.4   2018-03-15 local                           
 devtools    1.13.4  2017-11-09 CRAN (R 3.4.4)                  
 digest      0.6.15  2018-01-28 CRAN (R 3.4.3)                  
 graphics  * 3.4.4   2018-03-15 local                           
 grDevices * 3.4.4   2018-03-15 local                           
 memoise     1.1.0   2018-03-21 Github (hadley/memoise@611cfad) 
 methods   * 3.4.4   2018-03-15 local                           
 packrat     0.4.9-1 2018-03-12 CRAN (R 3.4.4)                  
 stats     * 3.4.4   2018-03-15 local                           
 tools       3.4.4   2018-03-15 local                           
 utils     * 3.4.4   2018-03-15 local                           
 withr       2.1.2   2018-03-21 Github (jimhester/withr@79d7b0d)

EDIT:

Seems to be fixed with new rmarkdown version from Github.

yihui commented 6 years ago

@cimentadaj The CRAN version of rmarkdown (1.9) should suffice.

gloaec commented 6 years ago

Hi there and thanks for your reactivity guys.

I'd like to report the case for beamer_presentation output as well.

> pandoc_version()
[1] ‘2.1.3’
> render('lecture.Rmd')
Error in (function (toc = FALSE, slide_level = NULL, incremental = FALSE,  : 
  unused argument (pdf_engine = "xelatex")

(https://github.com/rstudio/rmarkdown/blob/master/R/beamer_presentation.R#L67) (https://github.com/rstudio/rmarkdown/blob/master/R/beamer_presentation.R#L109) (https://github.com/rstudio/rmarkdown/blob/master/R/beamer_presentation.R#L154)

Aithosa commented 5 years ago

@yihui

hi, i meet the similar issue.

every time when i trying to knit this test.Rmd file download from Zh-beamer, the R Markdown console always tell me

processing file: test.Rmd
  |.............                                                    |  20%
  ordinary text without R code

  |..........................                                       |  40%
label: setup (with options) 
List of 1
 $ include: logi FALSE

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

  |....................................................             |  80%
label: unnamed-chunk-1
  |.................................................................| 100%
  ordinary text without R code

"D:/Program Files/Pandoc/pandoc" +RTS -K512m -RTS test.utf8.md --to beamer --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output test.tex --template beamer_default.tex --variable theme=Warsaw --variable fonttheme=professionalfonts --highlight-style pygments --pdf-engine pdflatex --self-contained --latex-engine=xelatex 
output file: test.knit.md

--latex-engine has been removed.  Use --pdf-engine instead.
Try pandoc.exe --help for more information.
错误: pandoc document conversion failed with error 2
停止执行

it happened just like the issue above, but i can knit most of other files successfully, which is annoying.

here is my output for devtools::session_info('rmarkdown')

> devtools::session_info('rmarkdown')
- Session info --------------------------------------------------------------------------------------------------------
 setting  value                         
 version  R version 3.5.1 (2018-07-02)  
 os       Windows >= 8 x64              
 system   x86_64, mingw32               
 ui       RStudio                       
 language (EN)                          
 collate  Chinese (Simplified)_China.936
 ctype    Chinese (Simplified)_China.936
 tz       Asia/Taipei                   
 date     2018-11-26                    

- Packages ------------------------------------------------------------------------------------------------------------
 package   * version date       lib source                            
 base64enc   0.1-3   2015-07-28 [1] CRAN (R 3.5.0)                    
 digest      0.6.18  2018-10-10 [1] CRAN (R 3.5.1)                    
 evaluate    0.12    2018-10-09 [1] CRAN (R 3.5.1)                    
 glue        1.3.0   2018-07-17 [1] CRAN (R 3.5.1)                    
 highr       0.7     2018-06-09 [1] CRAN (R 3.5.1)                    
 htmltools   0.3.6   2017-04-28 [1] CRAN (R 3.5.1)                    
 jsonlite    1.5     2017-06-01 [1] CRAN (R 3.5.1)                    
 knitr       1.20    2018-02-20 [1] CRAN (R 3.5.1)                    
 magrittr    1.5     2014-11-22 [1] CRAN (R 3.5.1)                    
 markdown    0.8     2017-04-20 [1] CRAN (R 3.5.1)                    
 mime        0.6     2018-10-05 [1] CRAN (R 3.5.1)                    
 Rcpp        1.0.0   2018-11-07 [1] CRAN (R 3.5.1)                    
 rmarkdown   1.10.16 2018-11-26 [1] Github (rstudio/rmarkdown@34d2fd0)
 stringi     1.2.4   2018-07-20 [1] CRAN (R 3.5.1)                    
 stringr     1.3.1   2018-05-10 [1] CRAN (R 3.5.1)                    
 tinytex     0.9.3   2018-11-25 [1] Github (yihui/tinytex@eacaaf1)    
 xfun        0.4     2018-10-23 [1] CRAN (R 3.5.1)                    
 yaml        2.2.0   2018-07-25 [1] CRAN (R 3.5.1)                    

[1] D:/R/R-3.5.1/library

and i have done this : devtools::install_github("rstudio/rmarkdown"), but it won't work...

by the way, i have installed texlive2018.

yihui commented 5 years ago

@Aithosa The problem came from @BruceZhaoR's example. Remove this: https://github.com/BruceZhaoR/Zh-beamer/blob/9a952673029161034c5899ea22f216d49a056c4b/_output.yaml#L2

I've submitted a PR: https://github.com/BruceZhaoR/Zh-beamer/pull/2

Aithosa commented 5 years ago

thanks a lot, i have checked the file you changed, it finally worked perfectly. i may need to learn more about latex and r markdown. 👍👍👍

Yihui Xie notifications@github.com 于2018年11月26日周一 下午11:20写道:

@Aithosa https://github.com/Aithosa The problem came from @BruceZhaoR https://github.com/BruceZhaoR's example. Remove this:

https://github.com/BruceZhaoR/Zh-beamer/blob/9a952673029161034c5899ea22f216d49a056c4b/_output.yaml#L2

I've submitted a PR: BruceZhaoR/Zh-beamer#2 https://github.com/BruceZhaoR/Zh-beamer/pull/2

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/rstudio/rmarkdown/issues/1183#issuecomment-441675833, or mute the thread https://github.com/notifications/unsubscribe-auth/AeiWrd7sI8cRGSYiNeS0HqnzJwgTOHbiks5uzAargaJpZM4QMHcb .

github-actions[bot] commented 4 years ago

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.