underline in markdown

There is not a way to add underlines with pure markdown (only bold and italics). Is there a way to add underline with R Markdown? Preferably something that would be compatible with PDF and HTML output.

Well, you can either create a CSS style or use \LaTeX

This line will render in an Rmd file for pdf output as an underscored sentence

$\text{\underline{This sentence underlined using \LaTeX}}$

(won't render here, because the output is HTML)

But html is clunkier

$\underline{This\space sentence\space underlined\space using\space \LaTeX}$

\underline{This\space sentence\space underlined\space using\space \LaTeX}

3 Likes

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.