Skip to content

support LaTeX titles by adding :include_mathjax option#331

Open
hhaensel wants to merge 3 commits intoJuliaPlots:masterfrom
hhaensel:master
Open

support LaTeX titles by adding :include_mathjax option#331
hhaensel wants to merge 3 commits intoJuliaPlots:masterfrom
hhaensel:master

Conversation

@hhaensel
Copy link
Collaborator

@hhaensel hhaensel commented Jun 2, 2020

I recently committed an :include_mathjax option for the plotly() backend in plot and wondered, whether I could reuse my experience for PlotlyJS and its respective Backend in plots.
This is, what I ended up with. This probably solves #60 and #325, at least partly.

WebIO currently does not support registering of directories with its dep2url routine and has some missing Windows support, which I addressed in JuliaGizmos/WebIO.jl#417

Meanwhile, I used AssetRegistry directly to work around this problem.

Usage: add include_mathjax = <mathjaxpath> to the Layout options.
mathjaxpath can be either "cdn", "local" (which looks whether mathjax is installed with IJulia) or a direct link to a mathjax file (local or remote).

Unfortunately, I couldn't find a way to implement this for the plot pane. MathJax only works, if the mathjax source is included in the head tag.
I have experimented with a script that appends MathJax to the header after document was loaded, but that version also only worked for the Blink display, so I chose to use this version, which is somehow cleaner.
Maybe, someone else can help?
Example:

plot(scatter(y=[2,3]), Layout(xaxis_title="\$\\Gamma\$", include_mathjax = "cdn"))

or from the Plots plotlyjs() backend

plot(1:2, include_mathjax="cdn", extra_kwargs = :plot, xlabel = "\$\\Gamma_1\$")

@hhaensel hhaensel changed the title support :include_mathjax optionMathjax Option support :include_mathjax option Jun 2, 2020
@hhaensel hhaensel changed the title support :include_mathjax option support LaTeX by adding :include_mathjax option for PlotlyJS as well as plotlyjs() backend of Plots Jun 2, 2020
@hhaensel hhaensel changed the title support LaTeX by adding :include_mathjax option for PlotlyJS as well as plotlyjs() backend of Plots support LaTeX titles by adding :include_mathjax option Jun 2, 2020
@jtschneider jtschneider mentioned this pull request Apr 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant