Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not possible use a newer version of Mathjax #1364

Open
piiskop opened this issue Jul 30, 2022 · 6 comments
Open

Not possible use a newer version of Mathjax #1364

piiskop opened this issue Jul 30, 2022 · 6 comments
Labels
bug an unexpected problem or unintended behavior

Comments

@piiskop
Copy link

piiskop commented Jul 30, 2022

MathJax has some packages optional. One of them is gensymb that can't be loaded via \require. If i still do \require{gensymb} then i see the message in the browser's console that says:

GET https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.9/extensions/TeX/gensymb.js?V=2.7.9 net::ERR_ABORTED 404

First thing to notice here is that an outdated version of MathJax will be referenced automatically. The current version should be 3.

The second thing to notice is that gensymb.js isn't available at the given address. So i followed the instruction at MathJax's homepage by adding these two snippets into my JS file that i use for adding elements to the page and there was no change in the outcome. i also have a current address inside _output.yml:

bookdown::bs4_book:
  css: style.css
  includes:
    in_header: js.html
  repo: https://github.com/piiskop/manual-for-rstudio
  math_method: 
    engine: mathjax
    url: https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml-full.js

That current address won't be used as i see in the console that it still tries to access the version 2.7.9.

As here is requested the session info i add it:

xfun::session_info('bookdown')

R version 4.2.1 (2022-06-23)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.4 LTS, RStudio 2022.2.2.485

Locale:
LC_CTYPE=et_EE.UTF-8 LC_NUMERIC=C LC_TIME=et_EE.UTF-8 LC_COLLATE=et_EE.UTF-8 LC_MONETARY=et_EE.UTF-8 LC_MESSAGES=et_EE.UTF-8 LC_PAPER=et_EE.UTF-8
LC_NAME=C LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=et_EE.UTF-8 LC_IDENTIFICATION=C

Package version:
base64enc_0.1.3 bookdown_0.27.3 bslib_0.4.0 cachem_1.0.6 digest_0.6.29 evaluate_0.15 fastmap_1.1.0 fs_1.5.2 glue_1.6.2 graphics_4.2.1 grDevices_4.2.1 highr_0.9
htmltools_0.5.3 jquerylib_0.1.4 jsonlite_1.8.0 knitr_1.39 magrittr_2.0.3 memoise_2.0.1 methods_4.2.1 R6_2.5.1 rappdirs_0.3.3 rlang_1.0.4 rmarkdown_2.14 sass_0.4.2
stats_4.2.1 stringi_1.7.8 stringr_1.4.0 tinytex_0.40 tools_4.2.1 utils_4.2.1 xfun_0.31 yaml_2.3.5

@cderv
Copy link
Collaborator

cderv commented Aug 24, 2022

There are two issues in one here:

For context, Mathjax 2 is still used by default because switching to 3 would break some existing content. Example of breakage possible: mathjax/MathJax#2312 but there will be others probably.

  • However, it should be possible to use custom mathjax. It was made possible recently in rmarkdown, but maybe we have an issue in bookdown that does not make it work despite our recent change. Possibly related to Custom MathJax URL not working #915 which require a not-so-small rewrite of this code part.

Thanks for the report, we'll look into this.

@cderv cderv changed the title "bookdown" uses outdated MathJax Not possible use a newer version of Mathjax Aug 24, 2022
@cderv cderv added the bug an unexpected problem or unintended behavior label Aug 24, 2022
@cderv
Copy link
Collaborator

cderv commented Jul 11, 2024

FWIW mathjax.rstudio.com/latest has been updated to 2.7.9

@piiskop
Copy link
Author

piiskop commented Jul 14, 2024

404 Not Found
Code: NoSuchKey
Message: The specified key does not exist.
Key: 2.7.9/undefined
RequestId: 3PX5WCH9W8AREG1S
HostId: 7+Nbzy3TQOq5WIO6BptIomauMTQIQ41cWznTzaCrcKt4kZqDfcjcvBY7er/pzkFEgtByUiKo8B4=

@cderv
Copy link
Collaborator

cderv commented Jul 15, 2024

@piiskop what did you try ? What does sharing this means ? There is unfortunately no contest to what you share in your latest comment.

If you are looking for the full mathjax url hosted and used by default with R Markdown, it will be https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML

@piiskop
Copy link
Author

piiskop commented Aug 18, 2024

I clicked the link in your response. What do you mean by sharing this? I did not write anything like that.

@yihui
Copy link
Member

yihui commented Aug 19, 2024

@piiskop I think he was telling you that the latest version of MathJax on mathjax.rstudio.com had been updated to 2.7.9. The link mathjax.rstudio.com/latest itself is invalid (hence you got the error mentioned in your reply), and the full valid link is in his next reply. By "sharing this", he meant that you shared an error message, but he had no idea about the context (how you ran into that error).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
Status: Backlog
Development

No branches or pull requests

3 participants