Skip to content

Commit

Permalink
LaTeX enable usage (#12)
Browse files Browse the repository at this point in the history
* Add LaTex usage info

* Improve error message
  • Loading branch information
jd-foster authored Sep 20, 2023
1 parent 8bac3f3 commit 0ad2e90
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,8 @@ or simply kill it:
```julia
PlotlyKaleido.kill_kaleido()
```

To enable LaTeX (using MathJax v2) in plots, use the keyword argument `mathjax`:
```julia
PlotlyKaleido.start(mathjax=true) # start Kaleido server with MathJax enabled
```
4 changes: 2 additions & 2 deletions src/PlotlyKaleido.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ function start(;plotly_version = missing,
)
end
if !(mathjax === missing)
if mathjax_version > v"2.7.9"
error("The given mathjax version $(mathjax_version) is greater than the last supported version of $(_mathjax_last_version).")
if mathjax_version > _mathjax_last_version
error("The given mathjax version ($(mathjax_version)) is greater than the last supported version ($(_mathjax_last_version)) of Kaleido.")
end
if mathjax isa Bool && mathjax
push!(chromium_flags, "--mathjax=$(_mathjax_url_path)/$(mathjax_version)/MathJax.js")
Expand Down

0 comments on commit 0ad2e90

Please sign in to comment.