I am new to r markdown and pandoc but not Rstudio.  Can anyone provide a more explicit treatment of the use of the filter code?
As stated, I am using Rstudio and would like to create a filter 'pandoc-word-pagebreak' which would incorporate the replacement of '\newpage' in my r markdown file with the appropriate xml.
I have tried copying
~~~{.haskell}
pgBrkXml
:: String
pgBrkXml
= "<w:p><w:r><w:br w:type=\"page\"/></w:r></w:p>"

pgBrkBlock
:: Block
pgBrkBlock
= RawBlock (Format "openxml") pgBrkXml
~~~
~~~
insertPgBrks
:: Block -> Block
insertPgBrks
(Para [Str "\newpage"]) = pgBrkBlock
insertPgBrks blk
= blk

main
= toJSONFilter insertPgBrks
~~~

into a text file titled pandoc-word-pagebreak in the working folder and called using

word_document:
    pandoc_args
: [
     
"--filter", "pandoc-word-pagebreak"
   
]
in the header but to no avail.
Clearly the syntax for the filter is not correct.
Any thoughts?
Thanks,
Joel

On Friday, October 3, 2014 at 9:55:22 AM UTC-4, Ken Kleinman wrote:
Hello, folks--

Can anyone help me figure out how to insert a page break into a .docx, using a file written in Markdown?

This ought to be possible with the \f escape code (formfeed), but using this results in a file that Word will not open, despite the fact that \n (newline) works fine.

Brief backstory: I'm using R and RStudio to write a mailmerge-like program with text and personalized graphics for an NIH-funded research project.  (RStudio uses Pandoc to convert from Markdown to .docx and pre-processing to run R code and insert results.)  The goal is to return to research participants some information about themselves in the context of the others in the study.  My plan is to generate some text and graphics within R and use Pandoc to generate the reports.  I've attached a (very) crude mock-up of a graphic below.  The page break is needed to separate reports for each individual in the project.

Many thanks!

--Ken Kleinman
Inline image 1

--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/2085f4cb-d713-4975-a739-9ad775cd37c4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.