R Markdown Hashtag Hover Output

Viewed 530

I am trying to create an R-Markdown document and for some reason on all headers of the document denoted by ### etc..., when I knit to html and hover over each word, an underlined hashtag appears. Is there a way to get rid of this in the output? As an example, below is the standards cars summary.

I tested on another machine and had no issues with the output. Could I be missing a certain package? I'm currently using Rstudio version 1.3.1093 and R version 4.0.3 on the PC that is not showing the correct output.

Thank you in advanceenter image description here

enter image description here

2 Answers

This is a new feature of the latest release of rmarkdown you can disable it by adding anchor_sections: FALSE to the yaml header, it's documented in the release notes

One solution is to override the CSS that is putting that # in there in the first place. Doing this means there will only be a cosmetic change, so no unintended side-effects.

Place a set of style tags after the YAML header and set the content of the a.anchor-section::before element to ''.

<style>
  a.anchor-section::before {
    content: '';
  }
</style>

If you use right-click your output html document and click inspect element you can dive into the CSS that controls each element - the default in this case is a.anchor-section::before {content: '#';}.

You probably also want to add this too

a.anchor-section {
  margin-left: 0;
}
Related