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

PPT fails if using --reference-doc along with intermediate_dir #1431

Closed
slopp opened this issue Aug 20, 2018 · 7 comments
Closed

PPT fails if using --reference-doc along with intermediate_dir #1431

slopp opened this issue Aug 20, 2018 · 7 comments
Assignees
Milestone

Comments

@slopp
Copy link
Contributor

slopp commented Aug 20, 2018

To reproduce, use the following command with the attached RMD:

rmarkdown::render('r4ds.Rmd', intermediates_dir = 'tmp')

This fails with:

/usr/local/bin/pandoc +RTS -K512m -RTS /home/sean/rmd2ppt/06-r4ds/tmp/r4ds.utf8.md --to pptx --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash+smart --output r4ds.pptx --reference-doc=./rstudio.pptx 
pandoc: ./rstudio.pptx: openBinaryFile: does not exist (No such file or directory)
Error: pandoc document conversion failed with error 1

Whereas the following works:

rmarkdown::render('r4ds.Rmd')

Session Info:

Session info ----------------------------------------------------------------------------------------------------------------
 setting  value                       
 version  R version 3.4.3 (2017-11-30)
 system   x86_64, linux-gnu           
 ui       RStudio (1.2.909.1)         
 language (EN)                        
 collate  en_US.UTF-8                 
 tz       America/New_York            
 date     2018-08-20                  

Packages --------------------------------------------------------------------------------------------------------------------
 package   * version date       source                            
 base64enc   0.1-3   2015-07-28 CRAN (R 3.4.1)                    
 digest      0.6.12  2017-01-27 CRAN (R 3.4.1)                    
 evaluate    0.11    2018-07-17 cran (@0.11)                      
 glue        1.3.0   2018-07-17 cran (@1.3.0)                     
 graphics  * 3.4.3   2017-11-30 local                             
 grDevices * 3.4.3   2017-11-30 local                             
 highr       0.6     2016-05-09 CRAN (R 3.4.1)                    
 htmldeps    0.1.1   2018-08-20 Github (rstudio/htmldeps@c1023e0) 
 htmltools   0.3.6   2017-04-28 CRAN (R 3.4.1)                    
 jsonlite    1.5     2017-06-01 CRAN (R 3.4.1)                    
 knitr       1.20    2018-02-20 CRAN (R 3.4.3)                    
 magrittr    1.5     2014-11-22 CRAN (R 3.4.1)                    
 markdown    0.8     2017-04-20 CRAN (R 3.4.1)                    
 methods   * 3.4.3   2017-11-30 local                             
 mime        0.5     2016-07-07 CRAN (R 3.4.1)                    
 Rcpp        0.12.12 2017-07-15 CRAN (R 3.4.1)                    
 rmarkdown   1.10.11 2018-08-20 Github (rstudio/rmarkdown@cac9e82)
 stats     * 3.4.3   2017-11-30 local                             
 stringi     1.2.4   2018-07-20 cran (@1.2.4)                     
 stringr     1.3.1   2018-05-10 cran (@1.3.1)                     
 tinytex     0.6     2018-07-07 cran (@0.6)                       
 tools       3.4.3   2017-11-30 local                             
 utils     * 3.4.3   2017-11-30 local                             
 xfun        0.3     2018-07-06 cran (@0.3)                       
 yaml        2.2.0   2018-07-25 cran (@2.2.0)     

rmd-ppt-template.zip

@yihui
Copy link
Member

yihui commented Aug 20, 2018

I guess this is essentially the same issue as #500 and is not specific to powerpoint_presentation (it must affect at least word_document, too). @rich-iannone Do you have time to create a patch? My guess is we need an intermediates_generator.

@yihui yihui added this to the v1.11 milestone Aug 20, 2018
@rich-iannone
Copy link
Member

I will work on this now. Could you elaborate on the idea of the intermediates_generator?

@rich-iannone rich-iannone self-assigned this Aug 20, 2018
@yihui
Copy link
Member

yihui commented Aug 20, 2018

See ?rmarkdown::output_format and also search for intermediates_generator in the source code of other output format functions.

rich-iannone referenced this issue in rich-iannone/rmarkdown Aug 21, 2018
yihui referenced this issue in rich-iannone/rmarkdown Dec 5, 2018
yihui added a commit to rich-iannone/rmarkdown that referenced this issue Dec 5, 2018
yihui added a commit that referenced this issue Dec 5, 2018
yihui referenced this issue in rich-iannone/rmarkdown Dec 5, 2018
yihui added a commit to rich-iannone/rmarkdown that referenced this issue Dec 5, 2018
@yihui
Copy link
Member

yihui commented Dec 5, 2018

Should be fixed now. Thanks for the report!

@bwiernik
Copy link
Contributor

bwiernik commented Feb 2, 2019

I don't understand the purpose of this line:

if (dirname(reference_doc) != '.') stop(

In psychmeta (https://github.com/psychmeta/psychmeta/blob/2447d1891bf41d6fa3aa34bd88adee91d9cc8ed2/R/output.R#L810), we provide a set of document templates in the package for outputting results as docx or odt. We access these using by specifying the reference_docx in an rmarkdown file using system.file("reference_docx.docx", package = "psychmeta").

With this change, rendering fails because the reference_docx file is not located in the same directory as the markdown script. I don't see why this check is necessary at all. file.copy() works fine with the reference file being located in a different directory.

@yihui
Copy link
Member

yihui commented Mar 7, 2019

Explained in #1526.

yihui added a commit to RLesur/rmarkdown that referenced this issue Apr 1, 2019
yihui pushed a commit to RLesur/rmarkdown that referenced this issue Apr 1, 2019
@github-actions
Copy link

github-actions bot commented Nov 3, 2020

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 Nov 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants