-
Notifications
You must be signed in to change notification settings - Fork 157
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
Fix MIME"text/latex"
output to ensure it's in a TeX environment
#763
Conversation
See the discussion in fonsp/Pluto.jl#488 and JuliaStrings/LaTeXStrings.jl#50 and fonsp/Pluto.jl#1164. IIUC, @stevengj makes the argument that no `MIME"text/latex"` output can be assumed to be a single LaTeX statement, which is reasonable, and the natural consequence of that is that no display environment using `MIME"text/latex"` should assume that the output is a single expression and put `$$ x $$` for you. And if that's the case, it's the job the displayer to output properly formatted TeX with the display environments defined. That is sensible, and we just need to make sure that Symbolics and ModelingToolkit does that everywhere.
Codecov Report
@@ Coverage Diff @@
## master #763 +/- ##
==========================================
- Coverage 76.85% 76.42% -0.44%
==========================================
Files 25 25
Lines 3180 3177 -3
==========================================
- Hits 2444 2428 -16
- Misses 736 749 +13
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
This change seems to have broken latexify of symbolics expressions in emacs-jupyter and I can't seem to figure out why this change was made even after reading though the linked issues. Before this change everything rendered fine in emacs-jupyter with the environment given in the recipe (which appears to be the equation environment for everything in symbolics). Now the environments are wrapped in the double dollar signs by default which won't render in emacs org-mode. Explicitly, after this change, this looks something like
For now it seems possible to work around it by using I tried to figure out how this is handled in pluto so that I could do something similar in emacs-jupyter, but couldn't see anything like |
Could you pls clarify where this |
|
In my case it does not get rid off these double dollar stuff. For example:
After:
It rather removed Perhaps suggestion from this |
I've applied a couple of workarounds as suggested -- but I think |
I'm seeing something similar when running Julia in a Jupyter notebook either using Jupyter lab or VS Code. If I save a notebook as LaTeX, the output from a Symbolics calculation has extra dollars, as in |
See the discussion in fonsp/Pluto.jl#488 and JuliaStrings/LaTeXStrings.jl#50 and fonsp/Pluto.jl#1164. IIUC, @stevengj makes the argument that no
MIME"text/latex"
output can be assumed to be a single LaTeX statement, which is reasonable, and the natural consequence of that is that no display environment usingMIME"text/latex"
should assume that the output is a single expression and put$$ x $$
for you. And if that's the case, it's the job the displayer to output properly formatted TeX with the display environments defined. That is sensible, and we just need to make sure that Symbolics and ModelingToolkit does that everywhere.