`math_method: "r-katex"` breaks HTML rendering
math_method: "r-katex" breaks HTML rendering.
If I set it to r-katex all generated HTML will have the Rmd header incorrectly added to the HTML:
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css" data-external="1">
---
title: '
---
R version 4.4.1 (2024-06-14)
Platform: aarch64-apple-darwin23.4.0
Running under: macOS 15.0
Locale: en_US.UTF-8 / en_US.UTF-8 / en_US.UTF-8 / C / en_US.UTF-8 / en_US.UTF-8
Package version:
base64enc_0.1.3 blogdown_1.19 bookdown_0.40 bslib_0.8.0
cachem_1.1.0 cli_3.6.3 digest_0.6.36 evaluate_0.24.0
fastmap_1.2.0 fontawesome_0.5.2 fs_1.6.4 glue_1.7.0
graphics_4.4.1 grDevices_4.4.1 highr_0.11 htmltools_0.5.8.1
httpuv_1.6.15 jquerylib_0.1.4 jsonlite_1.8.8 knitr_1.48
later_1.3.2 lifecycle_1.0.4 magrittr_2.0.3 memoise_2.0.1
methods_4.4.1 mime_0.12 promises_1.3.0 R6_2.5.1
rappdirs_0.3.3 Rcpp_1.0.13 rlang_1.1.4 rmarkdown_2.28
sass_0.4.9 servr_0.31 stats_4.4.1 tinytex_0.53
tools_4.4.1 utils_4.4.1 xfun_0.46 yaml_2.3.10
Hugo version: 0.134.2
I'm not sure what's going on here (sounds like a blogdown bug), but perhaps it will be easier if you just disable the math_method and load katex in your Hugo template: https://katex.org/docs/browser
This is what I did, but it would be great if the rendering can be done on the server side instead.
I'm not sure what's going on here (sounds like a blogdown bug), but perhaps it will be easier if you just disable the
math_methodand load katex in your Hugo template: https://katex.org/docs/browser
Rendering on the server side makes it possible to view the math expressions offline, but it will also blow up the size of the HTML document. If your goal is to view math offline, you may also consider saving a copy of katex to the static/ folder and link to it in a Hugo template.