Marcus Madison
Marcus Madison

Reputation: 13

Headings not working in my R markdown file

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

Upvotes: 1

Views: 3637

Answers (2)

grace
grace

Reputation: 1

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

Upvotes: 0

W. Joel Schneider
W. Joel Schneider

Reputation: 1806

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

Upvotes: 3

Related Questions