1. An amount between $5 and $10.
2. An amount between \$5 and \$10.
3. An amount between \\$5 and \\$10.
Please include the code chunk above in a blogdown .Rmd file, and make sure your Hugo theme supports LaTeX equations. Then Save
and serve your site with blogdown::serve_site()
. When I do this none of the three options shown above properly escape LaTeX's dollar sign $
.
Here's what happens to me (and yes I did update all packages with update.packages(ask = FALSE, checkBuilt = TRUE)
prior to trying this). These three results below are from the same three attempts above:
- The
and
in this statement is formatted in LaTeX style while everything else is formatted "normal". - The
and
in this statement is formatted in LaTeX style while everything else is formatted "normal" (in other words the results are exactly identical to number 1). - The LaTeX
$
is escaped but the sentence now displays as "An amount between \$5 and \$10." with one slash before each dollar sign.
How can I properly esacpe the dollar signs in this sentence "An amount between $5 and $10." with a Hugo theme that accepts LaTeX input?
I should mention that if I knit the same .Rmd file with Ctrl+Shift+K
the dollar sign does get escaped "properly" if I utilize the solution shown in example #2. The issue only appears when blogdown::serve_site()
serve my site, leading me to believe the issue is with Hugo themes accepting LaTeX input.
2.7.5
? Thanks – Misesteem