Search code examples
htmlrtitlequartobold

How to set the dynamic part of title as bold in a quarto document rendered as html?


How to set only the dynamic part of the title specified in the YAML (params$mytitle in the minimal example below) as bold in the rendered HTML? Tried this, but did not work.

---
params:
  mytitle: "title1"
title: "`r paste('this is',params$mytitle)`"
format: html
editor: visual
---

## Quarto

Quarto enables you to weave together content and executable code into a finished document. To learn more about Quarto see <https://quarto.org>.

Solution

  • You can use

    ---
    params:
      mytitle: "title1"
    title: "this is **{{< meta params.mytitle >}}**"
    format: html
    editor: visual
    ---
    

    to inject the parameter and make it even more bold. I see this output: enter image description here