-
Notifications
You must be signed in to change notification settings - Fork 233
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
Adapt github_document()
format for @includeRmd
#1304
Conversation
Looking at what is produced in the
Are image from the web possible to include in R HTML help page ? The solution to this may also be to deactivate completely the math support for roxygen2 For comparaison, this is what we get without no specific Math support In initial md file $$
\eta_{i} = (\beta_0 + b_{0i}) + \beta_1x_{i1}
$$ Result of Pandoc conversion
Result in Rd file
If the equation were to have some specific LaTeX command, we would get a warning and not transformation. Something like $ echo "$\frac{1}{2}$" | pandoc -t gfm
[WARNING] Could not convert TeX math \frac{1}{2}, rendering as TeX
$\\frac{1}{2}$ The Rd file will have this Trying to give more context on all this so that we can discuss and decide what should be done. |
If we want to deactivate with Obviously if we decide to make |
Looking closer at how to do math in Rd document, I believe this should be a better way: https://docs.ropensci.org/katex/reference/math_to_rd.html So I think it ok to deactivate webtex in the case of this PR. |
[skip ci]
@topepo @EmilHvitfeldt this should solve your issue and also undesired change in Rd file when running @gaborcsardi this PR does not deal with the fact that I don't think a user can adapt the rendering by setting a YAML header in the Rmd included. If we want to support that, this requires other adjustment. Not sure who should merge this, but this is ready on roxygen2 side. |
Looks good to me. |
This PR is in relation to rstudio/rmarkdown#2331
I believe the issue could be from the fact that
github_document()
is unnecessary rendering a HTML self_contained document.html_preview = FALSE
should be set in the case of@includeRmd
usage.We could obviously also make some adaption regarding the default value in rmarkdown side but this is not as straightforward (preview is want when rendered in background inside IDE)
There may be other adjustment needed so I am creating this as a draft for now until this is tested and sorted out.