From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/12577 Path: news.gmane.org!not-for-mail From: hjallen44-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Newsgroups: gmane.text.pandoc Subject: Re: How to get a page break (/f) from Markdown -> docx? Date: Mon, 20 Apr 2015 10:05:03 -0700 (PDT) Message-ID: <2085f4cb-d713-4975-a739-9ad775cd37c4@googlegroups.com> References: <65081506-a54b-4aff-96a0-d8e1cb6accc2@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_745_255192418.1429549503908" X-Trace: ger.gmane.org 1429549515 498 80.91.229.3 (20 Apr 2015 17:05:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 20 Apr 2015 17:05:15 +0000 (UTC) To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCCLTF6K4IOBBQHD2SUQKGQERBSLDZI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mon Apr 20 19:05:06 2015 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-yh0-f57.google.com ([209.85.213.57]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YkF85-0003xK-D4 for gtp-pandoc-discuss@m.gmane.org; Mon, 20 Apr 2015 19:05:05 +0200 Original-Received: by yhzz6 with SMTP id z6sf39068602yhz.0 for ; Mon, 20 Apr 2015 10:05:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :content-type:x-original-sender:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:sender:list-subscribe :list-unsubscribe; bh=rhbfLAyWMrwZEnm9iSM2P+v1JxAggivIoobY/Fs3ujQ=; b=K1JbgGzi2YV7ENJOLKfYt5JXYanTrpPTqWal6is52+cwzRWVSbdWKqcPHE20jIUeZX uY4+ZRTY5owrX+4n2SbUo6QunnyY0Sm4fUmaLMhC4y6Gh6AA1HfwGa7N5WqqyC0MhWie hB55CMdhDbnvCq3R0wU5WAZnetEmV3sWB7/NvO55O+zT76Podz0jWcVwHgFWnaqpW4qn b6VaExyWHW5SDbemxIdXKp9ibfViS22V9Wi+aAC9EaMZP5jlzibQG0uzLVa7/fsVMd4W oI8dL+GZzzMPV4QN1s43dUJBV8M7n5dARybSUseW3J2Fkux2dqH9LoznmLs5hx22c9Fu SAAQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :content-type:x-original-sender:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:sender:list-subscribe :list-unsubscribe; bh=rhbfLAyWMrwZEnm9iSM2P+v1JxAggivIoobY/Fs3ujQ=; b=cQcGBJZZHOHH5m36WJLUfj73VaxbUnR4k4buK3j+XpmA2JpKSaLFU2t74c4UOwADlS 7pbG4dajb0jGk9fJD9rqU1dgZQsYB6jnPMdlOvkqrckdY/KSab2UiQVDe4sdAsGVgtHc bILQyQ2QYORhsMRykWQzcpJ8gUwO5oLQ3ZskWqAXPGXaPgwqMmDyzSowIEHtvhZS3G89 5+nMMi6CoV9MPpoCg5Et/xXBx0Ro7kyyzOtgYs0LRyJ56o3fTEue00AxPBgYbMV8qt+p 6Ssdm3WQ5SkKCDrLtwEm6tZu2L9lJUL60VkkxudTDXDCe1xncOLQG6tBqQnp8EZG9cnF 4P9A== X-Received: by 10.140.83.165 with SMTP id j34mr204107qgd.23.1429549504639; Mon, 20 Apr 2015 10:05:04 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.140.87.69 with SMTP id q63ls2830735qgd.90.gmail; Mon, 20 Apr 2015 10:05:04 -0700 (PDT) X-Received: by 10.140.92.51 with SMTP id a48mr212547qge.16.1429549504295; Mon, 20 Apr 2015 10:05:04 -0700 (PDT) In-Reply-To: <65081506-a54b-4aff-96a0-d8e1cb6accc2-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> X-Original-Sender: hjallen44-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.org gmane.text.pandoc:12577 Archived-At: ------=_Part_745_255192418.1429549503908 Content-Type: multipart/alternative; boundary="----=_Part_746_494126267.1429549503908" ------=_Part_746_494126267.1429549503908 Content-Type: text/plain; charset=UTF-8 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 = "" 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 > [image: 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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. ------=_Part_746_494126267.1429549503908 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I am new to r markdown and pandoc but not Rstudio.  C= an anyone provide a more explicit treatment of the use of the filter code?<= br>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
=3D "<w:p><w:r><w:br w:type=3D\"page\"/></w= :r></w:p>"

pgBrkBlock
:: Block
= pgBrkBlock
=3D
RawBlock= (Format "openxml") pgBrkXml
~~~
~~~
insertPgBrks
::= Block -> Block
insertPgBrks
(Para [Str= "\newpage= "])= =3D pgBrkBlock
insertPgBrks blk <= /span>=3D<= span style=3D"color: #000;" class=3D"styled-by-prettify"> blk

main <= /span>=3D<= span style=3D"color: #000;" class=3D"styled-by-prettify"> toJSONFilter inse= rtPgBrks
~~~
=
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 correc= t.
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 Markdo= wn?

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

=
Brief backstor= y: I'm using R and RStudio to write a mailmerge-like program with text and = personalized graphics for an NIH-funded research project.  (RStudio us= es Pandoc to convert from Markdown to .docx and pre-processing to run R cod= e and insert results.)  The goal is to return to research participants= some information about themselves in the context of the others in the stud= y.  My plan is to generate some text and graphics within R and use Pan= doc 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 eac= h individual in the project.

Many thanks!

--Ken Kleinman
3D"Inline

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pand= oc-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.co= m.
For more options, visit http= s://groups.google.com/d/optout.
------=_Part_746_494126267.1429549503908-- ------=_Part_745_255192418.1429549503908--