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
Enhance OutputHtml rich output for better pdf rendering of Jupyter notebook #11362
Comments
comment:1
I thought this was on #10787, but now I see it is not. I'm going to point it here. I've been waiting on |
Changed keywords from none to latex, jupyter, mathjax |
comment:6
Still a problem in Jupyter Notebook with Sage 9.2.rc0. |
This comment has been minimized.
This comment has been minimized.
Branch: public/11362 |
comment:8
The PR adds a variable New commits:
|
Commit: |
Author: Dave Morris |
comment:10
I don't like the proposed solution. It seems a bandage. A general solution that would also solve possible future problems would be to introduce a new magic method obj.mathjax() which provides latex code renderable by mathjax and defaults to an alias of obj.latex() when it is not defined for obj. |
comment:11
I sympathize with what you are saying, and I considered that solution (except that my idea was to add a keyword (maybe I think of MathJax as being a version of latex, rather than a completely different format, so I think it is reasonable to just add a tweak to make it work better (as in my PR). The variable I added simply makes it possible to add definitions for latex macros that MathJax does not understand, and is completely analogous to the variable |
comment:12
How about using |
comment:13
Replying to @DaveWitteMorris:
It seems to me currently there is some unfortunate confused code in this respect in the rich output system in Sage. Perhaps straightening the confused code would give a natural solution of this ticket's problem. I will investigate more. |
comment:14
Related:
|
Changed author from Dave Morris to Kwankyu Lee |
Reviewer: Dave Morris |
This comment has been minimized.
This comment has been minimized.
Cayley table |
comment:20
Attachment: trac11362.ipynb.gz Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
Changed reviewer from Dave Morris to none |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:25
Stalled in |
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
Previously this ticket was for repairing "show for Cayley tables as MathJax does not support setlength".
While fixing that based on the latest Sage develop branch, I needed to augment
OutputHtml
rich output with latex whenever possible.With the branch, Cayley tables are rendered correctly in Jupyter notebook. Moreover, because of the patch for
OutputHtml
, the notebook is exported as pdf correctly.Checkout the uploaded Jupyterbook and try to export it as pdf.
Please test the branch for possible unexpected side effects, though I guess there would be none.
Below is the previous description of the ticket:
Define a finite group and its multiplication table:
The multiplication table can give latex code
to be copy-pasted in a paper:
but is also used for showing the table in a notebook worksheet.
In Sage 4.8 with SageNB we used to have:
In Sage 9.2.rc0 with Jupyter,
show(T)
doesdisplay a table but with
\setlength
displayedin red instead of contributing to the rendering.
CC: @slel @kwankyu
Component: notebook
Keywords: latex, jupyter, mathjax
Author: Kwankyu Lee
Branch/Commit: public/11362 @
f3ad938
Issue created by migration from https://trac.sagemath.org/ticket/11362
The text was updated successfully, but these errors were encountered: