I'm trying to create a table of contents with Rmarkdown in pdf_document2 format. However, some of my section headers are just new pages with latex text in them that I would like to be considered a separate section of the table of contents. Here's an example of what I have, (also apologies in advance, I'm new to stack):
enter code here
---
output:
bookdown::pdf_document2:
fig_caption: yes
toc: no
lof: yes
lot: yes
keep_tex: yes
pdf_document:
toc: no
bookdown::html_document2:
fig_caption: yes
toc: no
word_document: default
bibliography:
- Thesis_Citations.bib
- R_Citations.bib
csl: apa.csl
header-includes: \usepackage{setspace}\doublespacing \usepackage{lineno} \usepackage{placeins}
---
\\begin{center}
\\textbf{\\MY THESIS TITLE which I have in latex because of formatting requirements}
\\textsc{More formatting things} \\vspace{3 mm}
\\end{center}
\\newpage
# TABLE OF CONTENTS
\\tableofcontents
\\listoffigures
\\listoftables
\\newpage
# THESIS INTRODUCTION
Some introductory things
\\begin{center}
\\textbf{\\Large CHAPTER I: MY FIRST CHAPTER TITLE which I have in latex for formatting reasons}
\\textsc{More formatting}
\\end{center}
# CHAPTER I INTRODUCTION
More stuff
\\newpage
\\begin{center}
\\textbf{\\Large CHAPTER II: MY SECOND CHAPTER TITLE which I have in latex for formatting reasons}
\\textsc{More formatting}
\\end{center}
# CHAPTER II INTRODUCTION
More stuff
The above gives me the following output:
1 TABLE OF CONTENTS
List of Figures
List of Tables
2 THESIS INTRODUCTION
3 CHAPTER I INTRODUCTION
4 CHAPTER II INTRODUCTION
Where I would really like to have:
1 TABLE OF CONTENTS
List of Figures
List of Tables
2 INTRODUCTION
3 CHAPTER I TITLE
3.1 CHAPTER I INTRODUCTION
4 CHAPTER II TITLE
4.1 CHAPTER II INTRODUCTION
How do I fix this?
- I have
toc: noin the yaml because it would put the table of contents before the title page - Changing toc_depth doesn't help because I'm not trying to change the # headers