-
Notifications
You must be signed in to change notification settings - Fork 15
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
R markdown workflow for PPT #26
Comments
Hi @noamross Sure, I would be happy! I don't have much time available for that but I will do my best to help you if necessary. Maybe you can get help from this implementation: https://github.com/davidgohel/flextable/blob/d1bbbf6729100d06e0b35574911372391148ab99/R/printers.R#L94 I agree with you. A There maybe a difficulty when the plot contains raster as it generate png files to be registered from dir I'd like to avoid Word output. The device can not really be valid as Word ML does not allow real text boxes and the position is never really what it should be. https://github.com/davidgohel/rvg/blob/master/R/dml_docx.R#L30 (... I did not remove it from the package) |
Great. It'll take a couple of weeks but I'll get to this. Avoiding Word output makes sense. I could see a system with a series of "fall-back" devices but for now I'll keep this simple. I could actually see a system like what you have in worded along the lines of how htmlwidgets register Javascript dependencies. Office-specific objects could register post-processing functions they require after conversion. This would require some overarching Rmd types that could handle the extensions. (Maybe |
The development version of pandoc now allows passing of raw openxml into powerpoint: jgm/pandoc@5547cd6
Using this, I've been able to make a quick proof-of-concept of creating editable powerpoints through R Markdown:
(code blocks indented here to keep formatting)
I can probably put in a bit of work to try to make this a smooth workflow. There are several ways to approach this: PR into knitr an option for an
rvg
device, make a new rmarkdown format likervg_powerpoint
, or create an object type likervg_plot
that hasknit_print
methods to print rawopenxml
blocks. I figure the latter is the most flexible and will require the least of the user. The actual rendering can delayed untilknit_print
is called so that the method can choose dml_docx/dvg_pptx as appropriate, and fall back to a different graphics device for older pandoc/other output formats. I think one could use officer to read the PPTX template to set the plot properties correctly.Any thoughts on the best approach? Would you take a PR to rvg for
knit_print()
methods?The text was updated successfully, but these errors were encountered: