Closed cannorin closed 5 years ago
I've tried this in a couple of places and print preview seems to be working for me:
It's behaving right on Edge / Windows 10 and Safari / macOS.
Does LaTeX work correctly for you in a Python notebook when you download the html?
@cgravill It seems not to be the simplest repro.
It turned out that the XPlot.Plotly.fsx
is actually causing the problem:
Sorry for confusing you.
I've updated the issue accordingly.
Ah it's probably this then: https://github.com/plotly/plotly.py/issues/515
Ahh so is it not related to IFSharp? Sorry if so...
It's in-between. The way we, and others, load XPlot/Plotly looks like it's causing the issue. It looks like they have a new flag that might help us. Needs investigating.
I found a potential workaround for this of hiding MathJax (used for LaTeX) from Plotly so it won't mangle it. It follows on from what I did with @npmurphy who originally integrated XPlot into IFSharp. It works in the notebook and on print preview for me:
@cannorin if you get a chance could you confirm if works for you? It's on pull request #196
I also updated XPlot.Plotly and Plotly JavaScript to their latest stable version so will need to do a bit more testing elsewhere too.
@cgravill Thanks! I'll try later today.
@cgravill It worked very nicely! :+1:
btw I noticed F# highlighting is not working on the print preview. Am I missing something?
@cgravill It worked very nicely! +1
It also worked on my real notebooks which heavily use LaTeX and Plotly.
Great, thanks for testing. It looked good on my other tests too so I'll go ahead and merge.
On the F# highlighting, I don't think F# highlighting on print preview has ever worked. It's probably falling back on styling it as Python. Last time I looked into this sort of thing on #105 while I easily adjusted export the templates needed configuring inside the Python distribution. That seemed messy so it's been on hold until changes are made upstream or someone comes up with a good approach.
Thank you! Now I'll close this issue as solved.
Hmm... It looks really complicated. I think I might be able to override it with something like highlight.js. It's just an idea and will be a dirty workaround, though. Anyway, thanks for fixing this!
Description
LaTeX equations$..$
inside Markdown blocks are rendered in the notebook with MathJax, but not in the print preview and the downloaded HTML.When used with
XPlot.Plotly.fsx
, LaTeX equations$..$
inside Markdown blocks are rendered in the notebook with MathJax, but not in the print preview and the downloaded HTML.Repro steps
Change the cell to Markdown
Enter any LaTeX equation such as
$1+2$
3. Execute File>Print PreviewUse
#load "XPlot.Plotly.fsx
Execute File>Print Preview
Expected behavior
The equation will get rendered.
Actual behavior
$1+2$
is shown as-is.Known workarounds
Not known.Print the notebook directly to a PDF with the browser.
Related information