pkgdown
pkgdown copied to clipboard
[WARNING] Could not convert TeX math z = s\sqrt{n}, rendering as TeX
Hi, I have been trying to add a couple of inline equations to a github-hosted website using RStudio. It's my first such project -- and I'm unfamiliar with the workflow features in github and RStudio, so my localisation may be incorrect ... but I think it's most likely to be an issue with pkgdown or its setup on my RStudio client. If that's not a likely root cause please aim me elsewhere for assistance.
I have a few inline math callouts in my README.Rmd. The single-variable callouts (e.g. $s$) don't throw warnings when I invoke the "Build pkgdown" affordance in the AddIns of my project; but warnings are issued for $\sqrt{n}$. Screenshot below:
The README.md
looks fine to me, e.g. at $z = s\sqrt{n}$.
I believe docs/index.html
exhibits a defect at <span class="math inline">$z = \sqrt{n}$</span>
, due to the dollar signs -- which I imagine should be suppressed, as in the subsequent <span class="math inline"><em>s</em></span>
.
I have tried usethis::use_pkgdown_github_pages()
; but I get the same defective rendering of $\sqrt{n}$. I don't see any warning messages on the bot-triggered Action, screenshots below.
Please advise.
Locally I get the error too for https://github.com/maelle/tex, interesting. It's an error from Pandoc, I wonder whether that happens for only certain versions of Pandoc.
The problem does not happen if the same math is used in a vignette.
@maelle thanks for looking into this. I'm grateful that R has volunteers like you who are doing the hard yards of maintenance! I pushed my current version just now to github, with a workflow on readme.md (rather than on readme.Rmd as before) -- but https://cthombor.github.io/SafeVote/ still has the defective index.html:
Curiously -- and perhaps this is an important clue -- the sqrt callouts in https://github.com/cthombor/SafeVote are rendered correctly:
@cthombor I opened a PR #2263 with a possible fix (emphasis on possible) :-)