Maral Dorri
Maral Dorri

Reputation: 478

Make title of rmarkdown html output bold and divide to 2 lines

I try the following code to justify the main text and make the title bold. I want to choose where the line break is in my long title but when I knit the rmd file non of the style edits happens to the title section.

---
title: "my really really really really \n  really really long title"
author: "person"
date: "4/24/2020"
output:
  html_document:
    toc: true
    toc_float:
      collapsed: true
      smooth_scroll: false
    toc_depth: 4
    theme: yeti 
    highlight: tango
    code_folding: show
---

<style>
body {
text-align: justify}
title {
font-style: bold}
</style>

Upvotes: 2

Views: 5912

Answers (1)

Maral Dorri
Maral Dorri

Reputation: 478

You can format the title in YAML. **text** is used to make the title bold and <br> to break the line.

---
title: "**my really really really really <br>  really really long title**"
author: "person"
date: "4/24/2020"
output:
  html_document:
    toc: true
    toc_float:
      collapsed: true
      smooth_scroll: false
    toc_depth: 4
    theme: yeti 
    highlight: tango
    code_folding: show
---

my really really really really
really really long title

Upvotes: 6

Related Questions