Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Text Justification in Rmarkdown word document

When I create the word document in Rmarkdown, text is always left-aligned: enter image description here

Is it possible (and how) to justify the text in Rmarkdown?

like image 611
Jot eN Avatar asked May 14 '15 13:05

Jot eN


1 Answers

A template (i.e., like a custom style sheet) can be created in Word (or LibreOffice / OpenOffice), containing whatever page formatting and document styles you wish, and referenced from the rmarkdown file, i.e.,

---
title: "My Document"
output:
  word_document:
    reference_docx: mystyles.docx
---
...rest of your rmarkdown here...

See:

  • https://vimeo.com/110804387
  • http://rmarkdown.rstudio.com/word_document_format.html
  • http://rmarkdown.rstudio.com/articles_docx.html
like image 122
michael Avatar answered Oct 22 '22 21:10

michael