I have seen various solutions around which work for pdf and HTML document output. However, none worked for me for word output. When used |
as suggested here: Split the title onto multiple lines? simply made the whole title disappear. Here is the code:
---
title: |
| Supporting Information
| Development and mechanistic bla bla.
author: Some people
output:
word_document:
reference_docx: ACS SI style for RMD.docx
mainfont: Arial
---
<style>
body {
text-align: justify}
p {line-height: 1.5em;}
</style>
Any help would be much appreciated.
To break a line in R Markdown and have it appear in your output, use two trailing spaces and then hit return .
To write text in bold font, use a double asterix or underscores before and after the text.
After drag the lines you want to make comment, press SHIFT + CMD + C (macOS), SHIFT + CTRL + C (Windows). This is the shortcut of R Markdown editor (R Studio) to comment out.
The |
pipes do not work together with word. Set the title into ""
instead. For a line wrap in the title with output to word we can use:
\n
(important: headed by two spaces!).
---
title: "Supporting Information \nDevelopment and mechanistic bla bla."
author: Some people
output: word_document
---
Yielding
Empty lines
To achieve empty lines within the title word wants "something" in these lines, so we can set a non-breaking space after the line breaking code:
\n
(important again: \n
headed by two spaces!).
---
title: "Supporting Information \n \n Development and mechanistic bla bla."
author: Some people
output: word_document
---
Yielding
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With