-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Building gitbook with local mathjax gives Invalid argument error #668
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
Comments
Were you able to resolve this? I am getting the same error. |
Unfortunately, not... |
Sorry all, it has been a while. Thanks for your patience. As of today, I can't reproduce this issue with last version of packages and last pandoc 2.7. shipped with RStudio # work in temp folder
dir.create(tmp_dir <- tempfile())
old <- setwd(tmp_dir)
# download the example
url <- "https://github.com/rstudio/bookdown/files/2737261/local-mathjax-error-MWE.zip"
xfun::download_file(url)
#> [1] 0
list.files()
#> [1] "local-mathjax-error-MWE.zip"
unzip(basename(url))
list.files()
#> [1] "local-mathjax-error-MWE" "local-mathjax-error-MWE.zip"
# set wd to the downloaded folder
setwd(xfun::sans_ext(basename(url)))
list.files()
#> [1] "bookdown-minimal.Rproj" "index.Rmd"
# to see the file:
xfun::file_string("index.Rmd")
#> ---
#> title: "A Book"
#> author: "Frida Gomam"
#> site: bookdown::bookdown_site
#> documentclass: book
#> output:
#> bookdown::gitbook:
#> # default
#> mathjax: local
#> self_contained: false
#> #bookdown::pdf_book: default
#> ---
#>
#> # Hello World
#>
#> Hi.
#>
#> Bye.
#>
#> <!-- If you need PDF output, uncomment bookdown::pdf_book above in YAML. You will need a LaTeX installation, e.g., https://yihui.name/tinytex/ -->
#>
#> Sample formula:
#>
#> \begin{equation}
#> E = mc^2
#> (\#eq:mass-energy)
#> \end{equation}
# tested with pandoc 2.7.3
rmarkdown::find_pandoc(version = "2.7.3")
#> $version
#> [1] '2.7.3'
#>
#> $dir
#> [1] "C:/Program Files/RStudio/bin/pandoc"
# render the book with no error.
bookdown::render_book("index.Rmd")
#> processing file: _main.Rmd
#> output file: _main.knit.md
#> "C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS _main.utf8.md --to html4 --from markdown+autolink_bare_uris+tex_math_single_backslash --output _main.html --email-obfuscation none --wrap preserve --standalone --section-divs --table-of-contents --toc-depth 3 --template "C:\Users\chris\Documents\R\win-library\4.0\bookdown\templates\gitbook.html" --highlight-style pygments --number-sections --include-in-header "C:\Users\chris\AppData\Local\Temp\RtmpiaQHoi\rmarkdown-str4fc84c462a0b.html" "--mathjax=libs/mathjax-local/MathJax.js?config=TeX-AMS-MML_HTMLorMML" --lua-filter "C:/Users/chris/Documents/R/win-library/4.0/rmarkdown/rmd/lua/pagebreak.lua" --lua-filter "C:/Users/chris/Documents/R/win-library/4.0/rmarkdown/rmd/lua/latex-div.lua"
#>
#> Output created: _book/index.html
#> [1] "C:/Users/chris/AppData/Local/Temp/RtmpiaQHoi/file4fc81b2e2abb/local-mathjax-error-MWE/_book/index.html"
# clean
setwd(old)
unlink(tmp_dir, recursive = TRUE) @mterente, @ashgreat, If any of you two still encounter this issue can you provide more information please ? this issue you encountered should not be but let's also note that there is an issue with |
I still can't reproduce this and there was no answer since my last reply. I'll close this. Please open a new issue linking this one if you still have issues not covered by one of the other mathjax related ones. |
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary. |
Uh oh!
There was an error while loading. Please reload this page.
Hi all,
I'm trying to build a book in gitbook format with local mathjax, via the YAML header options:
However, I'm getting the following error:
Many thanks for this beautiful package!
Mihai
local-mathjax-error-MWE.zip
The text was updated successfully, but these errors were encountered: