kymotz
March 27, 2021, 12:56pm
1
I am using the latest version of RStudio and R Markdown as by 2021-03-27, on Windows 10. My Pandoc is of version 2.11.2.
I added the line smart: false
to the front matter of my rmd file inside the indented section following html_document:
, but the output does not change, as smart punctuation is still applied to what was ASCII punctuations in the original file. I tried using the 'output options' GUI, deselecting the option Use smart puntuation
and then selecting it again, but it did nothing but changing those false
to no
.
With smart: no
in the front matter, the first few lines of the knit message read:
"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS ttt.utf8.md --to html4 --from markdown+autolink_bare_uris+tex_math_single_backslash --output ttt.html
-smart
is not found in the message. It is supposed to be following markdown
as an extension, which worked well and disabled smart punctuation when I tried using pandoc with command lines:
pandoc smart.md -f markdown-smart -t html -o smart.html
Could it be a bug, or is there something wrong with my configuration? I'd appreciate any help.
cderv
April 6, 2021, 10:18am
2
Yes there was an issue with the smart argument. Since rmarkdown 2.2 it has been removed as an argument from html_document
and other formats.
Pandoc activate it by default and if you need to deactivate it, you need to use now:
output:
html_document:
md_extensions: -smart
See
opened 01:59PM - 18 Feb 20 UTC
closed 09:40PM - 28 May 20 UTC
The output formats have the `smart` parameter (e.g., `html_document`).
This par… ameter is passed to `smart_extension` and adds `+smart` when `TRUE` and adds nothing when `FALSE`.
https://github.com/rstudio/rmarkdown/blob/43def55d9001ced4526988cfd6feacb11fa6a7dc/R/output_format.R#L349-L351
However, the `smart` extension is enabled by default in the Pandoc's markdown.
https://github.com/jgm/pandoc/blob/9feefa39319358acc84811e6017aeea60f9140c3/MANUAL.txt#L2627-L2628
This means, the `smart` extension is enabled regardless of the `smart` parameter (i.e., `html_document(smart = TRUE)` and `html_document(smart = FALSE)` cause the same result).
Thus, I suggest to drop smart parameter from the output formats.
By doing this, the user-specified `smart` parameter will be silently ignored as ellipsis.
If users really have to toggle the `smart` extension, they can do so via the `md_extension` parameter (i.e., `md_extension = "-smart"` disables the smart extension).
Currently, users have to specify both `smart=FALSE` and `md_extension="-smart"` to disable the `smart` extension.
<!--
Please keep the below portion in your issue. Your issue will be closed if any of the boxes is not checked (i.e., replace `[ ]` by `[x]`). In certain (rare) cases, you may be exempted if you give a brief explanation (e.g., you are only making a suggestion for improvement). Thanks!
-->
---
By filing an issue to this repo, I promise that
- [x] I have fully read the issue guide at https://yihui.org/issue/.
- [x] I have provided the necessary information about my issue.
- If I'm asking a question, I have already asked it on Stack Overflow or RStudio Community, waited for at least 24 hours, and included a link to my question there.
- If I'm filing a bug report, I have included a minimal, self-contained, and reproducible example, and have also included `xfun::session_info('rmarkdown')`. I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version: `remotes::install_github('rstudio/rmarkdown')`.
- If I have posted the same issue elsewhere, I have also mentioned it in this issue.
- [x] I have learned the Github Markdown syntax, and formatted my issue correctly.
I understand that my issue may be closed if I don't fulfill my promises.
1 Like
system
Closed
April 13, 2021, 10:18am
3
This topic was automatically closed 7 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.