Open friendly opened 2 months ago
What's in your _pkgdown.yml
? This bit should be there, not in the vignette header.
template:
math-rendering: mathjax
also see @hadley's suggestion in one of these mathy issues to move to quarto, it will be the supported path moving forward (over bookdown, at least).
The strategy here https://github.com/r-lib/pkgdown/issues/2704#issuecomment-2307055568 gives you the nicest math rendering. I submitted a PR: https://github.com/friendly/matlib/pull/61.
Unfortunately equation cross-references don't appear to work yet.
Thanks so very much for the PR to use katex
. This solves the problem with partitioned matrices, but not as you note for equation numbers.
We have quite a few vignettes here, and it seems like a lot of work to convert to Quarto, even though that might be the way for the future.
[My env: R version 4.4.1, RStudio 2023.06.1, pkgdown 2.1.0]
This issue is similar to https://github.com/r-lib/pkgdown/issues/2739 in that it uses
bookdown::html_document2
I'm writing a vignette for the
matlib
package on our new facilities for creating LaTeX matrices & matrix equations in R. It creates more complex LaTeX than usual cases, but these should be handled bypkgdown
.The vignette in question has this YAML header (trying to use
mathjax
rather thanmathml
.There are two problems with what
pkgdown
produces compared to what I get when I just useknitr
on the vignette.Rmd
file:(1) Equation numbers don't appear and cannot be referenced
One example uses our functions as so to produce two equations with
\label{}
sThis produces the LaTeX code:
From
knitr
, this appears correctly as below, and the equations can be referenced with@ref(eq:svd)
From
pkgdown
, I get:(2) We introduce methods for partitioned matrices:
This generates the LaTeX code that uses a
\begin{array} ... \end{array}
environment with vertical & horizontal rules.In
knitr
, this works fine:But from
pkgdown
all I get is this:Are there any
pkgdown
settings I could try to change that might make these work?