I am making an Rmarkdown document that knits to an HTML page. Instead of separating some text sections with headers or bullets, I just want to draw horizontal lines between them.
According to http://rmarkdown.rstudio.com/authoring_basics.html this would be called a "horizontal rule" and I can do that with three or more ---
. However when I actually try to do this, various sections disappear from the html doc. Here is a very simple example of my code:
---
title: "formatting issue"
author: "rrr"
output:
html_document:
toc: true
toc_depth: 2
toc_float: true
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
# bla {.tabset}
## tab 1
---
**text1**
bla
---
**text2**
bla
---
**text3**
bla
---
## tab 2
bla
## tab 3
bla
# bla
bla bla bla bla
Notice that text sections text1 text2 and text3 do not all show up when you knit to html. When I mess around with it, I just end up with different ones missing or not, but I can't get them all to show up or figure out why.
Horizontal rules You can create a horizontal rule ( <hr /> ) by placing 3 or more hyphens, asterisks, or underscores on a single line by themselves. You can also place spaces between them.
headers - Place one or more hashtags at the start of a line that will be a header (or sub-header). For example, # Say Hello to markdown . A single hashtag creates a first level header. Two hashtags, ## , creates a second level header, and so on.
To break a line in R Markdown and have it appear in your output, use two trailing spaces and then hit return .
The horizontal break needs to be surrounded by a leading and following new line, like this:
## heading
much interesting text ...
---
## heading
more interesting text
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With