Re: [R] post_processor in rmarkdown not working

2017-09-08 Thread Duncan Murdoch
On 08/09/2017 3:56 AM, Thierry Onkelinx wrote: That is strange. Another function in the same package (INBOmd::inbo_rapport) uses the same trick. I think the issue there is that the LaTeX code is valid before the post-processor is run, it just re-orders things. So rmarkdown::render runs Pand

Re: [R] post_processor in rmarkdown not working

2017-09-08 Thread Thierry Onkelinx
That is strange. Another function in the same package (INBOmd::inbo_rapport) uses the same trick. I actually started by copying the post_processor() from that function. INBOmd::inbo_rapport() works both with and without BibTex. Working examples are source/inbo_rapport and source/inbo_rapport_basic

Re: [R] post_processor in rmarkdown not working

2017-09-07 Thread Duncan Murdoch
On 07/09/2017 2:04 PM, Duncan Murdoch wrote: On 07/09/2017 10:11 AM, Thierry Onkelinx wrote: Dear Duncan, Thanks for chiming in. Could you explain how you set debug() on post_processor()? I've tried adding debug(post_processor) to rsos_article() or adding debug(post_processor) when after post_p

Re: [R] post_processor in rmarkdown not working

2017-09-07 Thread Duncan Murdoch
On 07/09/2017 10:11 AM, Thierry Onkelinx wrote: Dear Duncan, Thanks for chiming in. Could you explain how you set debug() on post_processor()? I've tried adding debug(post_processor) to rsos_article() or adding debug(post_processor) when after post_processor was defined in the debugger. Neith

Re: [R] post_processor in rmarkdown not working

2017-09-07 Thread Duncan Murdoch
On 07/09/2017 10:11 AM, Thierry Onkelinx wrote: remove.packages("INBOmd") devtools::install_github("inbo/INBOmd@post_processor") setwd(system.file("rmarkdown/templates/rsos_article/skeleton", package = "INBOmd")) debug(INBOmd::rsos_article) rmarkdown::render("skeleton.Rmd") __

Re: [R] post_processor in rmarkdown not working

2017-09-07 Thread Thierry Onkelinx
Dear Duncan, Thanks for chiming in. Could you explain how you set debug() on post_processor()? I've tried adding debug(post_processor) to rsos_article() or adding debug(post_processor) when after post_processor was defined in the debugger. Neither work for me. All supporting files are available w

Re: [R] post_processor in rmarkdown not working

2017-09-07 Thread Duncan Murdoch
On 06/09/2017 5:41 AM, Thierry Onkelinx wrote: Dear all, I'm trying to write a post_processor() for a custom rmarkdown format. The goal of the post_processor() is to modify the latex file before it is compiled. For some reason the post_processor() is not run. The post_processor() does work when

Re: [R] post_processor in rmarkdown not working

2017-09-07 Thread Thierry Onkelinx
Dear Heinz, Yes. The idea of the post_processor() is that 1) pandoc converts the .md to .tex 2) the post_processors changes the .tex 3) the .tex is compiled into .pdf Hence the post_processors need to read, change and overwrite the tex output file. Best regards, ir. Thierry Onkelinx Instituut vo

Re: [R] post_processor in rmarkdown not working

2017-09-07 Thread Heinz Tuechler
Are you sure that you want to read in the output_file in text <- readLines(output_file, warn = FALSE)? best regards, Heinz Thierry Onkelinx wrote/hat geschrieben on/am 06.09.2017 11:41: Dear all, I'm trying to write a post_processor() for a custom rmarkdown format. The goal of the post_proce

[R] post_processor in rmarkdown not working

2017-09-06 Thread Thierry Onkelinx
Dear all, I'm trying to write a post_processor() for a custom rmarkdown format. The goal of the post_processor() is to modify the latex file before it is compiled. For some reason the post_processor() is not run. The post_processor() does work when I run it manually on the tex file. Any suggestio