Some help to write a doctoral thesis with R Markdown

144 Views Asked by At

I'm trying to figure out how I could write my doctoral thesis using R Markdown. Usually, I write articles with Latex. But, I'd like to be able to compile my file both for Word and pdf. Could you please help me understand how I could achieve that? I need to number the \frontmatter in roman numbers and the \mainmatter in arabic numbers.

This is my MWE:

---
title: "A title"
documentclass: book
classoption:
  - hidelinks
  - twoside
  - openright
papersize: a4paper
output:
  pdf_document:
    includes:
      in_header: Mypreamble.tex
    latex_engine: xelatex
    citation_package: biblatex
    toc: yes
    toc_depth: 4
    number_sections: yes
  html_document:
    toc: yes
    toc_depth: '4'
    df_print: paged
  word_document:
    toc: yes
    toc_depth: 4
date: "8 juillet 2022"
bibliography: Lectures.bib
fontsize: 12pt
geometry: left=4cm,right=4cm,top=4cm,bottom=4cm
linestretch: 1.2
toc-title: Plan
links-as-notes: yes
link-citations: yes
header-includes:
- \usepackage{fontspec}
- \setmainfont[Mapping=tex-text]{Arial}
- \usepackage [french]{babel}
- \usepackage[backend=biber,style=apa]{biblatex}
---

Introduction

1

There are 1 best solutions below

1
Danny Wong On

I did my PhD thesis entirely in R Markdown, outputting to Microsoft Word.

I have a Github repository here if it helps: https://github.com/dannyjnwong/PhD_Thesis

I have also previously blogged about the process here: https://dannyjnwong.github.io/Writing-a-multi-chapter-document-with-R-Markdown/