noamross / redoc

[NOTE: Project in suspended animation for now] Reversible Reproducible Documents
https://noamross.github.io/redoc
Other
514 stars 44 forks source link

Add handling of page breaks #13

Open ekothe opened 5 years ago

ekothe commented 5 years ago

redoc does not currently render page breaks when converting to word such that the \newpage latex command is ignored when creating the rdocx output.

It would be helpful to implement a filter as per (https://stackoverflow.com/a/49415018/9449563) to add page breaks created using \newpage to the .docx output (and ideally to convert page breaks added in word back to \newpage

noamross commented 5 years ago

New pages are right now not supported in markdown or in pandoc's conversion format, but adding richer features such as page breaks is a parallel project. Right now such features live in https://github.com/davidgohel/worded. We're coordinating closely so that redoc will eventually handle all the features in that format.

The most likely will be implemented by making such features R code with something like:

This text will be followed by a break page. `doc_pagebreak()`
tarleb commented 5 years ago

This might be helpful when converting to docx, but the reverse direction would be a problem.

ekothe commented 5 years ago

Ideally the same underlying markdown could be built as PDF (e.g. using papaja) or word (using redoc) by changing the output format in the YAML. It looks like @tarleb's option would allow that but @noamross's doc_pagebreak() probably would not. However, I can understand that coordinating with worded might constrain implementation.

(FWIW I've tested redoc on a papaja paper doing just this and the page breaks and styles are really the only major issues).