-
-
Notifications
You must be signed in to change notification settings - Fork 878
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
does not check that ghostscript exists when running pdfcrop #954
Comments
Thanks for the report, but I'm afraid this would mean too much responsibility on my side. The pdfcrop homepage has stated anyway that it depends on Ghostscript: http://pdfcrop.sourceforge.net and I have never received a report on this issue before, so I assume it is a rare issue. |
I have the same error when compiling some latex code with pdflatex.
|
I don't know if this is a problem, but I'm seeing this error when building a book with bookdown using the default demo book with one additional line:
Worth noting that the build doesn't fail so far as I can tell. I just happened to notice that error in the Travis CI log. |
@jtbayly That's too little information for us to tell anything. Please read and follow the issue guide exactly to provide all the required information. Thanks! |
I’m sorry, but I don’t have any idea what versions of things are used in the Travis CI build process (except Pandoc, which is specified in the demo book .travis.yml file as pandoc_version: 1.19.2.1). I also don’t know how to get an xfun session out of the Travis virtual machine. I’m just reporting it as a courtesy. If you care about it or think it’s worth looking into it, you can build the demo book with Travis CI, after adding a sub-directory with an image and that line above. Sorry I can’t provide more in this instance without more instruction. |
No worries. Could you at least provide a link to the Travis log (or better, your Github repo as a reproducible example)? Without further information, it's really hard to guess. There was a bug related to this before knitr 1.28, but I have fixed it earlier this year: https://github.com/yihui/knitr/releases/tag/v1.28 If you are using the latest version of knitr, I cannot think of a reason why this problem can still occur. |
This particular branch seems to build just fine, but has the error in the Travis CI log. Here's the Travis log. Perhaps the Travis CI builds aren't using knitr 1.28 yet? Edit: I managed to figure out how to output the xfun session info into the book, and here's what I got:
|
From https://travis-ci.org/github/warhornmedia/bookdown-test/builds/725242542, the actual error was:
That was caused by the fact that the image does not exist. The ghostscript issue caused a warning:
This only means figure cropping failed: https://bookdown.org/yihui/rmarkdown-cookbook/crop-plot.html I'm not sure if you really need this feature. If you don't, you can turn it off by setting
|
…hostscript are found (yihui/knitr#954), and do not limit this feature to non-Windows platforms
@dalupus I take back what I said in 2015. Looking at the replies above and linked issues, I feel that it is obviously a highly confusing problem to many people. Therefore I just added the check for the existence of |
I’m so sorry I sent the log with the additional error. That is definitely a separate issue that I was working on. I meant to send the data with only the Ghostscript error. |
@jtbayly No worries. I think we are all set now. You can either merge https://github.com/warhornmedia/bookdown-test/pull/1 or remotes::install_github(c('yihui/knitr', 'rstudio/rmarkdown')) |
* rstudio_origin/master: fix rstudio#1905: a chunk with the class "fold-hide" should only hide itself (rstudio#1906) bump version after merging rstudio#1899 lua filter -> Lua filter Add an argument `lua_filters` to pandoc_options() to store them in the output format object (rstudio#1899) recursve into the parent dir at the end also suppor dir input in proj_root() list.files() with full.names = TRUE (so the files could be read with corret paths), and pass down the `file`/`pattern` arguments in the recursion use our own proj_root() instead of introducing a dependency rename package_root() to proj_root() generalize the package_root() function to work with more types of projects Discover site generators in index.Rmd files in parent directories (rstudio#1898) only install pkgdown for website build (rstudio#1900) Generalize number sections (rstudio#1879) enable figure cropping in pdf_document() only when both pdfcrop and ghostscript are found (yihui/knitr#954), and do not limit this feature to non-Windows platforms add the citation entry for the R Markdown Cookbook add lua filter vignette to pkgdown website (rstudio#1894) close rstudio#1889: evaluate the output argument before changing working directory in pandoc_convert() (rstudio#1890)
Merge remote-tracking branch 'rstudio_origin/master' into css-slash-fix # By Yihui Xie (12) and others # Via GitHub * rstudio_origin/master: (22 commits) fix rstudio#1905: a chunk with the class "fold-hide" should only hide itself (rstudio#1906) bump version after merging rstudio#1899 lua filter -> Lua filter Add an argument `lua_filters` to pandoc_options() to store them in the output format object (rstudio#1899) recursve into the parent dir at the end also suppor dir input in proj_root() list.files() with full.names = TRUE (so the files could be read with corret paths), and pass down the `file`/`pattern` arguments in the recursion use our own proj_root() instead of introducing a dependency rename package_root() to proj_root() generalize the package_root() function to work with more types of projects Discover site generators in index.Rmd files in parent directories (rstudio#1898) only install pkgdown for website build (rstudio#1900) Generalize number sections (rstudio#1879) enable figure cropping in pdf_document() only when both pdfcrop and ghostscript are found (yihui/knitr#954), and do not limit this feature to non-Windows platforms add the citation entry for the R Markdown Cookbook add lua filter vignette to pkgdown website (rstudio#1894) close rstudio#1889: evaluate the output argument before changing working directory in pandoc_convert() (rstudio#1890) tweak news require Pandoc >= 1.14 xfun 0.16 is on CRAN now ... # Conflicts: # NEWS.md
… 2.4 Christophe Dervieux (7): add lua filter vignette to pkgdown website (#1894) only install pkgdown for website build (#1900) Add an argument `lua_filters` to pandoc_options() to store them in the output format object (#1899) lua filter -> Lua filter bump version after merging #1899 Export pkg_file_lua for package author to use (#1904) bump patch version J.J. Allaire (1): Discover site generators in index.Rmd files in parent directories (#1898) Jonathan Gilligan (2): Fix #1861: do not use backslashes as path-separators in CSS links (#1862) Add documentation about how render() sets output_format options from YAML parameters (#1907) JooYoung Seo (1): support number_sections for word_document() output (#1869) Kirill Müller (1): close #1889: evaluate the output argument before changing working directory in pandoc_convert() (#1890) Yihui Xie (26): start the next version require the data-latex attribute on fenced Div's again: rstudio/rmarkdown#1779 (comment) fix #1815: apply the lua filters pagebreak.lua and latex-div.lua to beamer_presentation replace base64enc with xfun::base64_encode/decode() xfun 0.16 is on CRAN now require Pandoc >= 1.14 tweak news add the citation entry for the R Markdown Cookbook enable figure cropping in pdf_document() only when both pdfcrop and ghostscript are found (yihui/knitr#954), and do not limit this feature to non-Windows platforms generalize the package_root() function to work with more types of projects rename package_root() to proj_root() use our own proj_root() instead of introducing a dependency list.files() with full.names = TRUE (so the files could be read with corret paths), and pass down the `file`/`pattern` arguments in the recursion also suppor dir input in proj_root() recursve into the parent dir at the end add news for #1878 tweak news and docs of #1904 system.file() will signal a similar error when length(package) != 1, so we don't need to repeat the message here (i.e., just let system.file() fail) make sure the rmarkdown/lua/ folder exists amend #1907: the @param field doesn't allow more than one paragraph, so we shouldn't add an empty line here fix the redirected URL remove the pandoc installation vignette, which is no longer useful fix some redirected URLs discoverd by R CMD check on win-builder fix some redirected URLs discovered by the CRAN incoming check (but not the check on win-builder, which is very weird...) enable _R_CHECK_CRAN_INCOMING_ for r-devel, to see if it could reveal potentially "problematic" URLs as CRAN currently tries to identify CRAN release v2.4 atusy (6): make metadata available before running pre_knit (#1855) Generalize number sections (#1879) fix #1905: a chunk with the class "fold-hide" should only hide itself (#1906) incorporate CSS styles from latest Pandoc's tempalte (#1878) also incorporate CSS styles from latest Pandoc's template into ioslides (#1908) fix #457 and fix #1864: add `template` to `output_render_files` of discover_rmd_resources() (#1865)
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. |
If you try to run knitr with pdfcrop installed but don't have ghostscript you get the error:
!!! Error: Ghostscript exited with error code 127!
from pdfcrop.
If you run pdfcrop in debug mode you find that this simply means it can't find ghostscript.
If pdfcrop has a dependency on ghostscript then it should be checked that it exists before running it and have a warning that it doesn't exist if it doesn't.
The text was updated successfully, but these errors were encountered: