Skip to content

Commit e3dbddc

Browse files
authored
Merge branch 'r-devel:main' into bug17703
2 parents e3600f4 + 4e6ef3c commit e3dbddc

File tree

4 files changed

+3
-37
lines changed

4 files changed

+3
-37
lines changed

src/library/tools/R/Rd2HTML.R

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,40 +1231,6 @@ Rd2HTML <-
12311231
doTexMath <- enhancedHTML && !uses_mathjaxr(Rd) &&
12321232
texmath %in% c("katex", "mathjax")
12331233

1234-
## KaTeX / Mathjax resources (if they are used)
1235-
if (doTexMath && texmath == "katex") {
1236-
KATEX_JS <-
1237-
if (dynamic) "/doc/html/katex/katex.js"
1238-
else "https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.js"
1239-
KATEX_CSS <- if (dynamic) "/doc/html/katex/katex.css"
1240-
else "https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css"
1241-
KATEX_CONFIG <-
1242-
if (dynamic) "/doc/html/katex-config.js"
1243-
else c("const macros = { \"\\\\R\": \"\\\\textsf{R}\", \"\\\\code\": \"\\\\texttt\"};",
1244-
"function processMathHTML() {",
1245-
" var l = document.getElementsByClassName('reqn');",
1246-
" for (let e of l) { katex.render(e.textContent, e, { throwOnError: false, macros }); }",
1247-
" return;",
1248-
"}")
1249-
}
1250-
if (doTexMath && texmath == "mathjax") {
1251-
MATHJAX_JS <-
1252-
if (dynamic && requireNamespace("mathjaxr", quietly = TRUE))
1253-
"/library/mathjaxr/doc/mathjax/es5/tex-chtml-full.js"
1254-
else
1255-
"https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml-full.js"
1256-
MATHJAX_CONFIG <-
1257-
if (dynamic) "/doc/html/mathjax-config.js"
1258-
else "../../../doc/html/mathjax-config.js"
1259-
}
1260-
if (enhancedHTML) {
1261-
PRISM_JS <-
1262-
if (dynamic) "/doc/html/prism.js"
1263-
else NULL # "../../../doc/html/prism.js"
1264-
PRISM_CSS <-
1265-
if (dynamic) "/doc/html/prism.css"
1266-
else NULL # "../../../doc/html/prism.css"
1267-
}
12681234
Rdfile <- attr(Rd, "Rdfile")
12691235
sections <- RdTags(Rd)
12701236
if (fragment) {

src/library/tools/R/toHTML.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ HTMLcomponents <- function(title = "R", logo = FALSE,
450450
else KATEX_CSS_STATIC
451451
KATEX_CONFIG <-
452452
if (dynamic) "/doc/html/katex-config.js"
453-
else c("const macros = { \"\\\\R\": \"\\\\textsf{R}\", \"\\\\code\": \"\\\\texttt\"};",
453+
else c(r"(const macros = { "\\R": "\\textsf{R}", "\\mbox": "\\text", "\\code": "\\texttt"};)",
454454
"function processMathHTML() {",
455455
" var l = document.getElementsByClassName('reqn');",
456456
" for (let e of l) { katex.render(e.textContent, e, { throwOnError: false, macros }); }",

tests/testit.html.save

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
44
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css">
55
<script type="text/javascript">
6-
const macros = { "\\R": "\\textsf{R}", "\\code": "\\texttt"};
6+
const macros = { "\\R": "\\textsf{R}", "\\mbox": "\\text", "\\code": "\\texttt"};
77
function processMathHTML() {
88
var l = document.getElementsByClassName('reqn');
99
for (let e of l) { katex.render(e.textContent, e, { throwOnError: false, macros }); }

tests/ver20.html.save

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
44
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css">
55
<script type="text/javascript">
6-
const macros = { "\\R": "\\textsf{R}", "\\code": "\\texttt"};
6+
const macros = { "\\R": "\\textsf{R}", "\\mbox": "\\text", "\\code": "\\texttt"};
77
function processMathHTML() {
88
var l = document.getElementsByClassName('reqn');
99
for (let e of l) { katex.render(e.textContent, e, { throwOnError: false, macros }); }

0 commit comments

Comments
 (0)