Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • markstat - page breaks and font style

    I have just discovered markstat (after using R markdown) and think it's great. It feels much more intuitive to use.

    I have a couple of questions:

    1. Is it possible to set page breaks when generating Word docs? I realise you can use multiple / to set new lines. I have also tried /newpage but no luck.
    2. How do you change the font in the resulting Word doc. I have gone into the ado plus folder and opened the markstat.docx template? and tried changing the font there, but I don't really know what I'm doing. Any assistance would be appreciated.

    Thanks,
    Paul

  • #2
    Hi Paul Sanfilippo. I am glad you like markstat and find it intuitive. The answers to your questions hinge on Pandoc, which is used by markstat to convert Markdown to various formats.

    1. There is no general way to generate page breaks in Pandoc, but there are workarounds for specific formats. When generating a Word document you can insert a page break using a raw block with the required open XML instruction. Try

    Code:
    ```{=openxml}
    <w:p><w:r><w:br w:type="page"/></w:r></w:p>
    ```
    2. Pandoc generates a Word document by reading a reference document. Your approach is exactly right; if you want to change the default font you change it in the reference document markstat.docx. I recommend that you make a copy in your working directory and modify that, as markstat always looks for ancillary files in the working directory and then the installation folder. This allows you to customize the reference document for each project.

    Hope this helps.

    Comment


    • #3
      That's excellent - thanks German.

      The page break works and I didn't realise I needed to modify the style (not the text already present in the doc). It now works.

      Regards,

      Paul

      Comment

      Working...
      X