Skip to content
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

support LaTeX titles by adding :include_mathjax option #331

Open
wants to merge 101 commits into
base: master
Choose a base branch
from

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
sglyon and others added 25 commits July 7, 2020 09:59
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* ENH: use PlotlyBase's Kaleido for savefig

* OPS: add pkg-butler

* DEPS: depend on plotlyBase 0.4

* ENH: delete pkg-butler  -- we need special CI

* ENH: update travis settings

* WIP: migrate docs to Documenter.jl instead of mkdocs
* Switch to Julia Artifacts for JS dependencies

* Try fixing sha256 hashes

* Switch to tarball artifact

* Fix :schema accesses
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
sglyon and others added 30 commits July 30, 2021 10:52
remove styles from docs as they are not supported anymore
enh: added new PlotlyBase methods for SyncPlot
needed for `add_layout_image!
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.

9 participants