How to Make a Line Break in rmarkdown Header?

Viewed 80

I am trying to insert a line break inside the header paragraph in rmarkdown.

---
title: "Untitled"
output: word_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
someValue <- 1
```

## `r paste0("1. Attempt to set line break here ->  \n new line with value: ", someValue)`

## `r paste0("2. Attempt Line Feed, U+000A here ->  ",intToUtf8(strtoi("0x000A"))," new line with value: ", someValue)`

## `r paste0("3. Attempt Vertical Tab, U+000B here ->  ",intToUtf8(strtoi("0x000B"))," new line with value: ", someValue)`

## `r paste0("4. Attempt Form Feed, U+000C here ->  ",intToUtf8(strtoi("0x000C"))," new line with value: ", someValue)`

## `r paste0("5.  Carriage Return, U+000D here ->  ",intToUtf8(strtoi("0x000D"))," new line with value: ", someValue)`

## `r paste0("6. Next Line, U+0085 here ->  ",intToUtf8(strtoi("0x0085"))," new line with value: ", someValue)`

## `r paste0("7. Line Separator, U+2028 here ->  ",intToUtf8(strtoi("0x2028"))," new line with value: ", someValue)`

## `r paste0("8.  Paragraph Separator, U+2029 here ->  ",intToUtf8(strtoi("0x2029"))," new line with value: ", someValue)`

## `r paste0("9.  Breaks ->  <br> new line with value: ", someValue)`

## `r paste0("|\n  |10. Pipes break here ->   \n  | new line with value: ", someValue)`

## `r paste0("|\n  <center>11. Center tag here ->   </center>\n  <center>new line with value: ", someValue, "</center>")`

## Unsuitable <br>  
## as giving two separate paragraps and wrong TOC

This code is returning wrong output.

enter image description here

Unfortunately I failed to get any useful information from here as well.

So I am stuck. Please, can anyone help me to set the line break from inside the R code?

Appended

upon @MrFlick comment.

Here is the desired output - a multiline (single) paragraph with user defined positions of line breaks (equivalent of Word's SHIFT + ENTER).

enter image description here

0 Answers
Related