Skip to content
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

Filenames beginning with "-" cause incorrect invocation of pandoc #2503

Closed
4 of 5 tasks
mbaynton opened this issue Aug 10, 2023 · 4 comments
Closed
4 of 5 tasks

Filenames beginning with "-" cause incorrect invocation of pandoc #2503

mbaynton opened this issue Aug 10, 2023 · 4 comments
Assignees
Labels
bug an unexpected problem or unintended behavior

Comments

@mbaynton
Copy link

mbaynton commented Aug 10, 2023

Steps to reproduce

  1. Create an R Markdown file whose name begins with a -, for example -3-something.Rmd
  2. rmarkdown::render('-3-something.Rmd')

Result

processing file: -3-something.Rmd
                                                                                          
output file: -3-something.knit.md

/usr/bin/pandoc +RTS -K512m -RTS -3-something.knit.md --to html4 --from markdown+autolink_bare_uris+tex_math_single_backslash --output -3-something.html --lua-filter /home/mbaynton/R/x86_64-pc-linux-gnu-library/4.3/rmarkdown/rmarkdown/lua/pagebreak.lua --lua-filter /home/mbaynton/R/x86_64-pc-linux-gnu-library/4.3/rmarkdown/rmarkdown/lua/latex-div.lua --self-contained --variable bs3=TRUE --section-divs --template /home/mbaynton/R/x86_64-pc-linux-gnu-library/4.3/rmarkdown/rmd/h/default.html --no-highlight --variable highlightjs=1 --variable theme=bootstrap --mathjax --variable 'mathjax-url=https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML' --include-in-header /tmp/Rtmp0WU9RC/rmarkdown-str1bc8d4b28f56f.html 
Unknown option -3.
Unknown option --something.knit.md.
Try pandoc --help for more information.
Error: pandoc document conversion failed with error 2

Checklist

When filing a bug report, please check the boxes below to confirm that you have provided us with the information we need. Have you:

  • formatted your issue so it is easier for us to read?

  • included a minimal, self-contained, and reproducible example?

  • pasted the output from xfun::session_info('rmarkdown') in your issue?

  • upgraded all your packages to their latest versions (including your versions of R, the RStudio IDE, and relevant R packages)?

  • installed and tested your bug with the development version of the rmarkdown package using remotes::install_github("rstudio/rmarkdown")?

@yihui yihui added the bug an unexpected problem or unintended behavior label Aug 15, 2023
@yihui yihui self-assigned this Aug 16, 2023
@cderv
Copy link
Collaborator

cderv commented Aug 18, 2023

Related issue at https://community.rstudio.com/t/error-pandoc-document-conversion-failed-with-error-6/171491/4

I think there the file start with (1) and we transform special character to -. Then this issue happens

@yihui
Copy link
Member

yihui commented Aug 18, 2023

I think we just need to shQuote() the pandoc_convert() input. I'll test it. That's not true. We need to add ./ before the paths instead.

@yihui yihui closed this as completed in 0200cc3 Aug 18, 2023
@yihui
Copy link
Member

yihui commented Aug 18, 2023

Should be fixed now. Thanks for the report!

remotes::install_github('rstudio/rmarkdown')

Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug an unexpected problem or unintended behavior
Projects
Archived in project
Development

No branches or pull requests

3 participants