rstudio / rmarkdown

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

--smart/-S is said to have been removed in Pandoc 2.0 #1120

Closed yihui closed 7 years ago

yihui commented 7 years ago

This issue has been fixed: install.packages("rmarkdown")


Moving from https://github.com/rstudio/bookdown/issues/412:

--smart/-S has been removed.  Use +smart or -smart extension instead.
For example: pandoc -f markdown+smart -t markdown-smart.
Try pandoc --help for more information.
Error: pandoc document conversion failed with error 2
Please delete sde.Rmd after you finish debugging the error.
Execution halted

Change --smart to +smart.

yihui commented 7 years ago

From https://github.com/rstudio/bookdown/issues/475, --latex-engine has been changed to --pdf-engine in Pandoc 2.0.

kenarab commented 7 years ago

I had yet the same problem while executing devtools:document, after brew update including pandoc in OSX.

It seems became a blocking bug for those which develop packages with no clear origin but a wrong pandoc call.

> devtools::build()
'/Library/Frameworks/R.framework/Resources/bin/R' --no-site-file --no-environ --no-save  \
  --no-restore --quiet CMD build '/Users/kenarab/git/Rpolyhedra' --no-resave-data --no-manual 

* checking for file ‘/Users/kenarab/git/Rpolyhedra/DESCRIPTION’ ... OK
* preparing ‘Rpolyhedra’:
* checking DESCRIPTION meta-information ... OK
* installing the package to build vignettes
* creating vignettes ... ERROR
--smart/-S has been removed.  Use +smart or -smart extension instead.
For example: pandoc -f markdown+smart -t markdown-smart.
Try pandoc --help for more information.
Error: processing vignette 'Rpolyhedra.Rmd' failed with diagnostics:
pandoc document conversion failed with error 2
Execution halted
Error: Command failed (1)

I have installed the development version of markdown

devtools::install_github("rstudio/markdown")

But still doesn't works.

I will downgrade pandoc for beeing able to work with package development until is solved.

yihui commented 7 years ago

@kenarab It is rmarkdown instead of markdown:

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

Thanks @yihui. It worked installing rmarkdown development version. A turnaround until current version of rmarkdown is in CRAN.

devtools::install_github("rstudio/rmarkdown")

Maybe is good to speed up rmarkdown CRAN publication of current version.

yihui commented 7 years ago

@kenarab Yep, we do plan to release the current devel version to CRAN relatively soon. Pandoc 2.0 was released last night, and I guess the problem will first hit Homebrew users who have installed Pandoc. Thanks for the report!

rdrr1990 commented 7 years ago

I've been working on a set of Rmd documents, all of which were knitting fine to HTML, docx and PDF (just regular Rmd, not bookdown). When I brew upgraded to pandoc 2.0 this afternoon, I started seeing the --smart error described above. After

devtools::install_github("rstudio/rmarkdown")

I was able to knit to HTML and docx but not PDF. Instead I get the following:

pdf-engine /Library/TeX/texbin/pdflatex is not compatible with output format latex
Error: pandoc document conversion failed with error 1

I am using R 3.4.2, RStudio 1.1.383 on Mac OSX with

pdflatex --version
pdfTeX 3.14159265-2.6-1.40.18 (TeX Live 2017)
kpathsea version 6.2.3
Copyright 2017 Han The Thanh (pdfTeX) et al.     [copyright details omitted]
Compiled with libpng 1.6.29; using libpng 1.6.29
Compiled with zlib 1.2.11; using zlib 1.2.11
Compiled with xpdf version 3.04

This is not urgent in that I'm able to create PDFs by reverting

brew switch pandoc 1.19.2.4

Is there a way to knit PDFs with pandoc 2.0?

yihui commented 7 years ago

@rdrr1990 Thanks! I'll investigate it tomorrow.

pat-s commented 7 years ago

I confirm the error on macOS with pandoc 2.0.

@rdrr1990 This is only possible if the old version is not automatically removed (as for me). Currently it is not possible to install an older version of pandoc from hombrew/core. Could you upload the latest v1 binary (1.19.2.4) to homebrew so that users can do a brew install pandoc@1.19.2.4? Would be great!

I also tried installing the latest v1 using the pandoc.rb formula directly but Github says that the history is too long... I could also do it locally but have no time right now.

If one has the url to the old v1 pandoc.rb this would also help 👍

kenarab commented 7 years ago

With @leobelen we prepared the configuration for installing pandoc@1.19 vía brew as an emergency tweak. We finally find the way recompiling the package, but It seems to be necesary. We will publish it today.

kenarab commented 7 years ago

Te mencione en el issue para q subas el pandoc 1.9

Enviado desde el móvil

El 31 oct. 2017, a la(s) 06:40, Patrick Schratz notifications@github.com escribió:

I confirm the error on macOS with pandoc 2.0.

@rdrr1990 This is only possible if the old version is not automatically removed (as for me). Currently it is not possible to install an older version of pandoc from hombrew/core. Could you upload the latest v1 binary (1.19.2.4) to homebrew so that users can do a brew install pandoc@1.19.2.4? Would be great!

I also tried installing the latest v1 using the pandoc.rb formula directly but Github says that the history is too long... I could also do it locally but have no time right now.

If one has the url to the old v1 pandoc.rb this would also help 👍

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

rdrr1990 commented 7 years ago

@pat-s My impression is that you can't upload unverified bottles to brew -- is there some way? In the meantime, this should work:

wget https://github.com/jgm/pandoc/archive/1.19.2.4.tar.gz
brew install 1.19.2.4.tar.gz

(see pandoc archive)

leobelen commented 7 years ago

The issue is that Pandoc is not compilable using the standard compile tools but uses cabal-install (part of haskell) instead. I have already pushed a 'pandoc@1.19' formula, and I am waiting for the approval of Homebrew... hopefully it will get approved soon and we can download it... the only caveat is that it downloads with it ghc which is a 1G package...

yihui commented 7 years ago

I'll investigate this issue soon, but it sounds like that none of you guys actually use the RStudio IDE? I'm wondering because RStudio ships Pandoc 1.19, and rmarkdown won't use your Pandoc 2.0 if you didn't install it. In other words, brew remove pandoc and using RStudio should temporarily solve this issue. If you need RStudio's pandoc to be available system wide, you can symlink /Applications/RStudio.app/Contents/MacOS/pandoc/pandoc to, for example, /usr/local/bin.

kenarab commented 7 years ago

We use RStudio IDE. Didn't knew RStudio came with pandoc.

Also, when I ran

brew  unistall pandoc

It returned:

$ brew uninstall pandoc
Uninstalling /usr/local/Cellar/pandoc/2.0... (125 files, 56.8MB)
pandoc 1.19.2.4 1 is still installed.
Remove all versions with `brew uninstall --force pandoc`.

So uninstalling a brew package, unmask the last version (1.19) installed. So it fix it even if RStudio didn't came with pandoc. Interesting... Less to do with R/RStudio than with brew this issue... LOL

yihui commented 7 years ago

Good to know. I thought you didn't like the version of pandoc bundled in RStudio. If that is not the case, you don't really have to install pandoc separately.

rdrr1990 commented 7 years ago

I use RStudio all the time. For my purposes, the bundled version is not only fine but the main one I'm interested in for users. I was more just curious whether the little RMarkdown demo I've been working on would knit with Pandoc 2.0 or not (presumably the bundle version will change at some point...).

yihui commented 7 years ago

Okay, I think this issue should be resolved now. Again:

devtools::install_github("rstudio/rmarkdown")

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

rdrr1990 commented 7 years ago

works for me--PDF, HTML, and docx all build fine on my mac with that new github version!

yihui commented 7 years ago

@rdrr1990 Thanks! Actually you reminded me of a remaining issue with Word output, and I just pushed a fix e0339d3fb8d4adcc945fdafa5cdc45b02a7da9d2.

pat-s commented 7 years ago

So uninstalling a brew package, unmask the last version (1.19) installed.

@kenarab this only works if you do not clean up (brew cleanup) after doing brew upgrade - you should (imho) unless you want to keep all old bottles of formulas you installed. They occupy quite some space over time..

@yihui thanks!

johnfarias commented 7 years ago

I use eclipse-statet and had the same problem. I installed: devtools::install_github("rstudio/rmarkdown") and then, library(rmarkdown) the problem was solved using next configuration in eclipse>Run>External tools>External tools configurations:

image

image

An example: image

yueqin-li commented 6 years ago

i could not use devtools::install_github("rstudio/rmarkdown") to solve the problem and it showed that -bash: syntax error near unexpected token `"rstudio/rmarkdown"'. Anyone have some ideas about this?

yihui commented 6 years ago

@yueqin-li This has been fixed long time ago, and you can just install from CRAN: install.packages("rmarkdown").

yueqin-li commented 6 years ago

@yihui Yeah, I got your point that packages("rmarkdown") should be installed. But whenever I tried to do this with 'devtools::install_github("rstudio/rmarkdown"' or 'install.packages("rmarkdown")', it always shows that '-bash: syntax error near unexpected token ···'. Do you have any solutions for this? Thanks!

yihui commented 6 years ago

@yueqin-li So it seems you just cannot install any packages, and your R installation seems to be broken somehow. I have no idea what this error message means. Without seeing your devtools::session_info(), my blind shot in the dark would be to reinstall R.

stevekm commented 5 years ago

I am getting this error with the following Dockerfile installation, which was the only way I could get the following packages installed together in one place

$ cat Dockerfile
FROM ubuntu:16.04

RUN apt-get update && \
apt-get install -y wget \
bzip2 \
make \
rsync \
libcairo2-dev

RUN wget https://repo.continuum.io/miniconda/Miniconda3-4.4.10-Linux-x86_64.sh && \
bash Miniconda3-4.4.10-Linux-x86_64.sh -b -p /conda && \
rm -f Miniconda3-4.4.10-Linux-x86_64.sh
ENV PATH="/conda/bin:${PATH}"

RUN conda install -y -c r \
r=3.3.2 \
r-base=3.3.2 \
pandoc=2.2.3.2 \
r-reshape2=1.4.2 \
r-knitr=1.15.1 \
r-rmarkdown=1.3 \
r-ggplot2=2.2.0 \
r-dt=0.2 \
r-gridextra=2.2.1 \
bioconda::r-plotly=4.5.6 \
bioconda::r-venndiagram=1.6.16

error message:

>     rmarkdown::render(
+         input = 'report.Rmd',
+     output_format = 'html_document',
+     output_file = 'report.html'
+     )

/conda/bin/pandoc +RTS -K512m -RTS report.utf8.md --to html --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output report.html --smart --email-obfuscation none --self-contained --standalone --section-divs --table-of-contents --toc-depth 3 --template /conda/lib/R/library/rmarkdown/rmd/h/default.html --no-highlight --variable highlightjs=1 --number-sections --variable 'theme:bootstrap' --include-in-header /tmp/Rtmp9PHnR3/rmarkdown-str66a3a39f2e4bb.html --mathjax --variable 'mathjax-url:https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'
--smart/-S has been removed.  Use +smart or -smart extension instead.
For example: pandoc -f markdown+smart -t markdown-smart.
Try pandoc --help for more information.
Error: pandoc document conversion failed with error 2
Execution halted
cderv commented 5 years ago

This is because you use rmarkdown 1.3 with Pandoc 2+ .

r-rmarkdown=1.3 pandoc=2.2.3.2

rmarkdown compatibility with pandoc 2 is from version 1.7 and above.

You either need to downgrade pandoc to a version before 2 or upgrade rmarkdown to at least version 1.7 (that is the one which includes the fix for this issue bye the way - it is normal you encounter it)

Hope it helps

stevekm commented 5 years ago

Well, the reason I install with conda is to try to avoid such version compatibility issues; I didn't pick these versions, conda did. Is there a correct place to report the incompatibility for the conda package listings? Thanks.

cderv commented 5 years ago

For reference, conda dependency for this package

(base) C:\Users\chris>conda search r-rmarkdown==1.3 --info
Loading channels: done
r-rmarkdown 1.3 r3.3.2_0
------------------------
file name   : r-rmarkdown-1.3-r3.3.2_0.tar.bz2
name        : r-rmarkdown
version     : 1.3
build       : r3.3.2_0
build number: 0
size        : 1.9 MB
license     : GPL-3
subdir      : win-64
url         : https://repo.anaconda.com/pkgs/r/win-64/r-rmarkdown-1.3-r3.3.2_0.tar.bz2
md5         : eb97a67fd14e485843ebd9d66da5df9d
dependencies:
  - pandoc >=1.19.2
  - r-base 3.3.2*
  - r-base64enc
  - r-catools
  - r-evaluate >=0.8
  - r-htmltools >=0.3.5
  - r-jsonlite
  - r-knitr >=1.14
  - r-rprojroot
  - r-yaml >=2.1.5

I don't know where you can report, but there are several groups to ask this I think https://conda.io/en/latest/help-support.html

Personaly, for R project with docker, I would use rocker images on docker hub, and install r package using R directly.

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.