Skip to content

Not possible use a newer version of Mathjax #1364

Open

Description

@piiskop

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

Activity

  1. cderv commented on Aug 24, 2022

    @cderv
    Collaborator

    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.

  2. changed the title [-]"bookdown" uses outdated MathJax[/-] [+]Not possible use a newer version of Mathjax[/+] on Aug 24, 2022
  3. added
    bug
    on Aug 24, 2022
  4. cderv commented on Jul 11, 2024

    @cderv
    Collaborator

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

  5. piiskop commented on Jul 14, 2024

    @piiskop
    Author

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

  6. cderv commented on Jul 15, 2024

    @cderv
    Collaborator

    @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

  7. piiskop commented on Aug 18, 2024

    @piiskop
    Author

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

  8. yihui commented on Aug 19, 2024

    @yihui
    Collaborator

    @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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions