Search code examples
textsyntaxquarto

Is it possible to underline text without HTML syntax in Quarto?


I was wondering if it is possible to underline text without HTML syntax in Quarto? You can strikethrough the text using ~~ syntax like this:

~~mytext~~

Output:

enter image description here

So I was wondering if it is possible to underline your text with somehow similar syntax like above?


Solution

  • If you want just to use css, you may try the following,

    ---
    format: html
    ---
    
    ## Quarto
    
    [This text is underlined]{style="text-decoration: underline;"}
    

    underlined text


    But the above approach will only work for html output format. If you want to get underlined text for html, pdf or docx output, try the following syntax, (which is handled by the pandoc itself)

    ---
    format: html # pdf or docx
    ---
    
    ## Quarto
    
    [This text is underlined]{.underline}