Knitr / Rmd: adding a cover page and text when converting to MS Word

I try to write a report using the rmarkdown package, and, as it is, unfortunately, are usually transmitted in the form of MS Word documents in my field reports. Therefore, I can not always rely on the power of LaTeX and should be able to convert my .Rmd to MS Word. Now, since I want to be able to create PDF and MS Word files from the same source file, I am trying to find a common way to do this. PDF works for me using the apa6 class LaTeX-document. The .Rmd file will look something like this, creating a Word file:

 --- title: My title abstract: This is the abstract. author: John Doe affiliation: Unknown note: Nothing to say. output: word_document: reference_docx: myreference.docx --- Lorem ipsum. 

I can create a Word document from this, but for obvious reasons, my custom yaml -variables (like abstract) will not appear in the document.

Basically, my problem is this:

When creating a dictionary document, how can I add a cover page (including the names of authors, branches, author's notes, etc.) and another page with only a thesis in front of the document body ("Lorem ipsum")? The trick here is not to create page breaks (there are other open questions on this ), but rather ** is there a way to make pandoc use custom yaml variables put them at the top of the document and style them?

The rmarkdown package provides an include() function, but it only works with HTML and PDF documents.

+5
source share

Source: https://habr.com/ru/post/1210262/


All Articles