代码之家  ›  专栏  ›  技术社区  ›  ForEverNewbie

如何在呈现为html的quarto文档中将标题的动态部分设置为粗体?

  •  0
  • ForEverNewbie  · 技术社区  · 2 年前

    如何在呈现的HTML中仅将YAML中指定的标题的动态部分(下面的最小示例中为params$mytitle)设置为粗体?尝试 this ,但不起作用。

    ---
    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>.
    
    1 回复  |  直到 2 年前
        1
  •  1
  •   MrFlick    2 年前

    您可以使用

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

    注入参数并使其更加大胆。我看到这个输出: enter image description here