From 0ad2e90851fc99de7ef6bcc8397137b92cecbd14 Mon Sep 17 00:00:00 2001 From: James Foster <38274066+jd-foster@users.noreply.github.com> Date: Wed, 20 Sep 2023 00:34:40 -0600 Subject: [PATCH] LaTeX enable usage (#12) * Add LaTex usage info * Improve error message --- README.md | 5 +++++ src/PlotlyKaleido.jl | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bee7de2..1ca5252 100644 --- a/README.md +++ b/README.md @@ -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 +``` \ No newline at end of file diff --git a/src/PlotlyKaleido.jl b/src/PlotlyKaleido.jl index 6ac65f7..df603de 100644 --- a/src/PlotlyKaleido.jl +++ b/src/PlotlyKaleido.jl @@ -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")