I tried to knit a document and received the following error code:
output file: -3--Table-1a--Participant-Characterization-.knit.md
Unknown option -3.
Unknown option ---Table-1a--Participant-Characterization-.knit.md.
Try pandoc --help for more information.
Error: pandoc document conversion failed with error 6
Execution halted
I looked at this thread and it seems that I have the right version of pandoc:
rmarkdown::pandoc_exec()
[1] "/Applications/RStudio.app/Contents/Resources/app/quarto/bin/tools/pandoc"
rmarkdown::find_pandoc()
$version
[1] ‘3.1.1’
$dir
[1] "/Applications/RStudio.app/Contents/Resources/app/quarto/bin/tools"
Sys.getenv("RSTUDIO_PANDOC")
[1] "/Applications/RStudio.app/Contents/Resources/app/quarto/bin/tools"
cderv
August 16, 2023, 11:53am
2
What is the name of your document ? Does it have dash in it ? or even start with a dash ?
It seems the name could be a problem when passed to pandoc as command line argument
Document name does not have dashes
cderv
August 18, 2023, 12:00pm
4
No dash but it starts with a non alphanumeric character. (1)
. Probably in your example shared before it was (3)
. Parenthesis are special character in file name so it is replaced by -
, hence the starting dash in Pandoc's error.
This is related to this issue
opened 02:50PM - 10 Aug 23 UTC
closed 04:43PM - 18 Aug 23 UTC
bug
<!--
Welcome to the rmarkdown GitHub repo!
We are always happy to hear feedb… ack from our users.
To file a _bug report_, please follow these instructions carefully: <https://yihui.org/issue/#bug-reports>
Also, please complete and keep the checklist below in your issue. This helps you know what to check for opening a good issue report. It also helps know that you've have done the common steps that can solve your potential issue.
At last, if you have posted the same issue elsewhere, please mentioned it (with a link to the other issue).
-->
## 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:
- [x] [formatted your issue](https://yihui.org/issue/#please-format-your-issue-correctly) so it is easier for us to read?
- [x] included a minimal, self-contained, and reproducible example?
- [ ] pasted the output from `xfun::session_info('rmarkdown')` in your issue?
- [x] upgraded all your packages to their latest versions (including your versions of R, the RStudio IDE, and relevant R packages)?
- [x] installed and tested your bug with the development version of the rmarkdown package using `remotes::install_github("rstudio/rmarkdown")`?
and we'll try to improve and fix this for next version
system
Closed
October 2, 2023, 12:00pm
5
This topic was automatically closed 45 days after the last reply. New replies are no longer allowed. If you have a query related to it or one of the replies, start a new topic and refer back with a link.