benmarwick / rrtools

rrtools: Tools for Writing Reproducible Research in R
Other
671 stars 85 forks source link

Page breaking in the paper.Rmd file #49

Closed wolass closed 6 years ago

wolass commented 6 years ago

There are requirements by some of the journals to provide tables on separate pages. Is it possible to do in the Rmarkdown file?

I have noticed people using Heading 5 (#####) with the paragraph style performing a page break but I find it a bit hacky.

Is there a better solution to this issue? maybe also one that does not require shady-Haskell-recompilation of the pandoc filters??

nuest commented 6 years ago

What format do you hand in at the journal? Since it has pages, I assume PDF... and with PDF output, you can force a new page with the LaTeX command \newpage, see also https://stackoverflow.com/a/25241605

benmarwick commented 6 years ago

This is a good question, I've also run into this need. I most often need to submit MS Word documents (\newpage doesn't work), so I've been using the 'heading 5' trick, which I think is currently included in the docx template here.

wolass commented 6 years ago

@nuest I'm using Word files (and I think most of the users still will in my field - health sciences) @benmarwick I don't think it is in that template

nuest commented 6 years ago

Right, then my comment was not helpful. I know now also about the heading 5 trick - I hope I don't need it myself :-)

Have you tried inserting simply the code for a page break, or is that swallowed by pandoc? Other than that, the filter seems to be the remaining solution..

benmarwick commented 6 years ago

Yes, you're right, it's not in the current github version of rrtools (I just have a local copy), perhaps we can add it in after we merge your #48 PR (or as part of that, if you like, up to you).

@nuest thanks for the suggestions, unfortunately the <w:p><w:r><w:br w:type=\"page\"/></w:r></w:p> code has no effect in an Rmd rendered to MS Word. If only it was that easy!

benmarwick commented 6 years ago

I've added the MS Word page break method to the MS Word doc template now.