[WARNING] Could not convert TeX math z = s\sqrt{n}, rendering as TeX

My updates to the README in my RStudio project are no longer updating the top level of Election Vote Counting with Safety Features • SafeVote. Quite possibly I have forgotten the sequence of steps which had worked for me in the past, or I have done something to muck up the workflow settings (either in RStudio or in github), or... well I'm now totally confused and would greatly appreciate assistance!

Here's what I do know: On some (but not all) of my recent attempts to update my github website, I see a couple of console warnings, informing me that pkgdown "Could not convert TeX math ...". Screenshot below.

In the Render pane I see some output (apparently produced by pandoc):

"C:/Program Files/RStudio/resources/app/bin/quarto/bin/tools/pandoc" +RTS -K512m -RTS README.md --to html4 --from markdown+autolink_bare_uris+tex_math_single_backslash --output pandoc1eb546efe76ad.html --lua-filter "C:\Users\cthom\AppData\Local\R\win-library\4.2\rmarkdown\rmarkdown\lua\pagebreak.lua" --lua-filter "C:\Users\cthom\AppData\Local\R\win-library\4.2\rmarkdown\rmarkdown\lua\latex-div.lua" --embed-resources --standalone --variable bs3=TRUE --section-divs --template "C:\Users\cthom\AppData\Local\R\win-library\4.2\rmarkdown\rmd\h\default.html" --no-highlight --variable highlightjs=1 --variable theme=bootstrap --mathjax --variable "mathjax-url=https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" --include-in-header "C:\Users\cthom\AppData\Local\Temp\RtmpeC4JUD\rmarkdown-str1eb542b8a1282.html" 
[WARNING] This document format requires a nonempty <title> element.
  Defaulting to 'README' as the title.
  To specify a title, use 'title' in metadata or --metadata title="...".

Output created: C:/Users/cthom/AppData/Local/Temp/Rtmpac8AJq/preview-1dc0c2f084bab.dir/README.html

Here are my current points of confusion:

  1. Should I be editing README.Rmd or README.md? Both files inform me (in a comment): "README.md is generated from README.Rmd. Please edit that file". Hmmm... which of these two files is "that file"? The demonstrative pronoun "that" generally refers to something farther away than "this"; so I guess I should be editing README.md? But... that doesn't make any sense, because if README.md is truly "generated from" README.Rmd, then any edits to README.md will be lost. I have tried futzing around with README.md, and its preview does render \sqrt{n} nicely, whereas the knit of README.Rmd previews as a clumsy extended-ASCII rendering... but I'm almost 100% certain that I should be editing README.Rmd. To confirm this interpretation, just now (while creating this post) I executed use_readme_rmd(open = rlang::is_interactive())... which created a new README.Rmd file. At the beginning of this boilerplate file, I see the now-familiar comment informing me that I should be editing "that file". Oh yeah. Well... clearly the intent is that I should edit the boilerplate! So... I stumble forward onto step 2:

  2. Even though I don't find "devtools::build_readme()" to be particularly "handy" (because I have a poor longterm memory for such commands)... I gave it a go (once again) because that's what's recommended in the boilerplate. This yielded the same-old result: an updated README.Rmd, but no flow-through to the index.html on my github website -- even after pkgdown build, and a commit/push/pull to github.

  3. Reading through the boilerplate README.Rmd, I am (once again) bemused by the suggestion that "An example workflow can be found here: ...". Well... yeah... I see about a bazillion workflows when I visit that URL. I can't guess which one is the "example" being referenced by the boilerplate. Scrolling down through this long and highly-detailed webpage, I eventually notice a section suggesting that, as a first-time user, I might want to use usethis::use_github_action("check-release"). Sure. Why not? I gave that a go ... it ran pretty quickly, and apparently updated some yaml file. What to do next? Well... it seems possible that this workflow is related, somehow, to the "Build/Check Package" affordance in RStudio; so I poked at that. As I had hoped... my project still has a clean build. But... a commit/push/pull of all changed files doesn't get the math to display properly on the index.html on my SafeVote webarea.

  4. It's far from clear to me whether the RStudio workflow "should" be producing (say) a README.html file which github will rename index.html; or why the doc/index.html I see in my RStudio project (and at github.com) contains <span class="math inline">$z = s\sqrt{n}$</span> which renders (unsurprisingly) incorrectly, due to the $ escapes.

  5. At one point in time I had tried \eqn callouts in my README but I'm pretty sure they never were effective at inlining math.

  6. In an earlier attempt to resolve this issue I updated to v2.19 of rmarkdown.... which is what I was running when creating this issue.

Can you help? I'm pretty much out of ideas on what else I might try.

Please understand that it's my first experience with RStudio.

I hasten to add that -- overall I am extremely impressed with the usability and the (apparently very low) defect-rate in RStudio -- works very nicely indeed! And... I do know that cross-platform workflows are fundamentally nasty: difficult to configure, and unmaintainable (unless the other platform is completely stable and AFAIK that's far from the case with github), and just about impossible to diagnose when things go wrong if (as is the case here) there are a bazillion settings which a naive (or overly "clever") luser might change, and then "forget" that they have changed. All to say that I'm happy that it's only the top-level of my SafeVote webarea that's giving me trouble... but it is the landing page so I do want to sort this out.

README.Rmd

Is how I’d interpret it.

If it were me, I’d render from the source pane, confirm the datetime of the related HTML. That divides the problem into the two pieces—syntax in the source or clobbering in other parts of the workflow.

Hi technocrat, thanks for the prompt reply & suggestion!

I'm not sure what you mean by "render from the source pane". I see a knit affordance on the RStudio pane that displays README.Rmd. When I invoke knit, it renders the inline math (poorly) but without a warning message into a preview html, screenshot below.

Of possible relevance: the "Knit Directory" is the "Project Directory":

Also of possible relevance: there are "No parameters defined for the current R Markdown document":

The datestamp on the README.md file is updated, and the datestamp on the file I'm hoping to find a way to update (docs/index.html) is unchanged.

Because the root cause may lie within pkgdown (rather than in how pkgdown has been configured, or called, by a workflow script), I have created
an issue there

1 Like

This topic was automatically closed after 45 days. New replies are no longer allowed.


If you have a query related to it or one of the replies, start a new topic and refer back with a link.