walmes .
2014-Aug-28 19:06 UTC
[R] Apply rmarkdown::render() outside the RStudio don't find pandoc
Hello, I want to render a Rmd file using rmarkdown::render() function but I'm used to edit files with Emacs and I open a linux terminal session to compile this file with knitr::knit2html() ## On the linux terminal. $ echo "require(knitr); knit2html('teste01.Rmd')" | R --vanilla I want to use rmarkdown::render instead. When I tried this, with a R session open in the linux terminal, I get the message ## In a R session inside the linux terminal> rmarkdown::render("teste01.Rmd")Error: pandoc version 1.12.3 or higher is required and was not found. So I open the the teste01.Rmd file in RStudio and clicked on the "knit HTML" button and it works. The output is bellow. ## Output in the RStudio after clicking on the "Knit HTML" button. processing file: teste01.Rmd |............. | 20% ordinary text without R code |.......................... | 40% label: unnamed-chunk-1 |....................................... | 60% ordinary text without R code |.................................................... | 80% label: unnamed-chunk-2 (with options) List of 1 $ echo: logi FALSE |.................................................................| 100% ordinary text without R code output file: teste01.knit.md */usr/lib/rstudio/bin/pandoc/pandoc* teste01.utf8.md --to html --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash-implicit_figures --output teste01.html --smart --email-obfuscation none --standalone --section-divs --table-of-contents --toc-depth 3 --template /home/walmes/R/x86_64-pc-linux-gnu-library/3.1/rmarkdown/rmd/h/default.html --css /home/walmes/Dropbox/ridiculas/markdown/ridiculas.css --variable theme:cerulean --include-in-header /tmp/RtmpkgSjDp/rmarkdown-str4aee5c225085.html --mathjax --variable mathjax-url: https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML --no-highlight --variable highlightjs=teste01_files/highlight --variable highlightjs-theme=textmate Output created: teste01.html Its possible to see that RStudio call the pandoc that is at */usr/lib/rstudio/bin/pandoc/* and not the old version of pandoc in my system. I try overcome this by creating an alias *pandoc='/usr/lib/rstudio/bin/pandoc/pandoc'*, bus this doesn't work. Someone has any idea to solve this? I want to use rmarkdown::render() outside the RStudio. Thanks. Walmes. =========================================================================Walmes Marques Zeviani LEG (Laborat?rio de Estat?stica e Geoinforma??o, 25.450418 S, 49.231759 W) Departamento de Estat?stica - Universidade Federal do Paran? fone: (+55) 41 3361 3573 skype: walmeszeviani homepage: http://www.leg.ufpr.br/~walmes linux user number: 531218 ========================================================================= [[alternative HTML version deleted]]
Yihui Xie
2014-Aug-28 19:56 UTC
[R] Apply rmarkdown::render() outside the RStudio don't find pandoc
Please check out the instructions here: https://github.com/rstudio/rmarkdown/blob/master/PANDOC.md Creating an alias might work, although I have not really tried. What I have been doing is to uninstall the old version of Pandoc in my system, and create symlinks following the instructions above. You said> I try overcome this by creating an alias > *pandoc='/usr/lib/rstudio/bin/pandoc/pandoc'*, bus this doesn't work.but you did not describe what "this doesn't work" really means (whenever you report something that does not work, please attach the error message so we do not have to imagine what could be wrong). Anyway, at least you have to let your system know where is pandoc-citeproc (per instructions above again), which may or may not be the problem given the missing error message. Regards, Yihui -- Yihui Xie <xieyihui at gmail.com> Web: http://yihui.name On Thu, Aug 28, 2014 at 2:06 PM, walmes . <walmeszeviani at gmail.com> wrote:> Hello, > > I want to render a Rmd file using rmarkdown::render() function but I'm used > to edit files with Emacs and I open a linux terminal session to compile > this file with knitr::knit2html() > > ## On the linux terminal. > $ echo "require(knitr); knit2html('teste01.Rmd')" | R --vanilla > > I want to use rmarkdown::render instead. When I tried this, with a R > session open in the linux terminal, I get the message > > ## In a R session inside the linux terminal >> rmarkdown::render("teste01.Rmd") > Error: pandoc version 1.12.3 or higher is required and was not found. > > So I open the the teste01.Rmd file in RStudio and clicked on the "knit > HTML" button and it works. The output is bellow. > > ## Output in the RStudio after clicking on the "Knit HTML" button. > > processing file: teste01.Rmd > |............. | 20% > ordinary text without R code > > |.......................... | 40% > label: unnamed-chunk-1 > |....................................... | 60% > ordinary text without R code > > |.................................................... | 80% > label: unnamed-chunk-2 (with options) > List of 1 > $ echo: logi FALSE > > |.................................................................| 100% > ordinary text without R code > > > output file: teste01.knit.md > > */usr/lib/rstudio/bin/pandoc/pandoc* teste01.utf8.md --to html --from > markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash-implicit_figures > --output teste01.html --smart --email-obfuscation none --standalone > --section-divs --table-of-contents --toc-depth 3 --template > /home/walmes/R/x86_64-pc-linux-gnu-library/3.1/rmarkdown/rmd/h/default.html > --css /home/walmes/Dropbox/ridiculas/markdown/ridiculas.css --variable > theme:cerulean --include-in-header > /tmp/RtmpkgSjDp/rmarkdown-str4aee5c225085.html --mathjax --variable > mathjax-url: > https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML > --no-highlight --variable highlightjs=teste01_files/highlight --variable > highlightjs-theme=textmate > > Output created: teste01.html > > Its possible to see that RStudio call the pandoc that is at > */usr/lib/rstudio/bin/pandoc/* and not the old version of pandoc in my > system. > > I try overcome this by creating an alias > *pandoc='/usr/lib/rstudio/bin/pandoc/pandoc'*, bus this doesn't work. > Someone has any idea to solve this? I want to use rmarkdown::render() > outside the RStudio. > > Thanks. > Walmes. > > =========================================================================> Walmes Marques Zeviani > LEG (Laborat?rio de Estat?stica e Geoinforma??o, 25.450418 S, 49.231759 W) > Departamento de Estat?stica - Universidade Federal do Paran? > fone: (+55) 41 3361 3573 > skype: walmeszeviani > homepage: http://www.leg.ufpr.br/~walmes > linux user number: 531218 > ==========================================================================