Headings not working in my R markdown file

2k Views Asked by At

I recently finished my R notebook, and noticed something once I decided to knit the markdown file. None of the headings or bullet points were working! I had to install XQuartz to finish knitting the markdown file since I have a mac. Is this something that's normal or can I fix this?

enter image description here

2

There are 2 best solutions below

1
On BEST ANSWER

I haven't seen your rmarkdown, but I suspect that you need to add a blank line above each heading. For example, putting a heading right after a list (or any other structure) sometimes results in problems:

1. First item
2. Second item
3. Third item
# First level heading

However, adding a blank line before each heading usually fixes the problem:

1. First item
2. Second item
3. Third item

# First level heading
0
On

Your headings do not work because you didn't leave a space between "#" and the next character.

This will not work:

##Main Questions

Instead, do this:

## Main Questions