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

SageMath: LaTex rendering of output not showing in nteract #3364

Open
dkumor opened this issue Sep 25, 2018 · 9 comments
Open

SageMath: LaTex rendering of output not showing in nteract #3364

dkumor opened this issue Sep 25, 2018 · 9 comments

Comments

@dkumor
Copy link

dkumor commented Sep 25, 2018

I am on Arch Linux, running latest nteract from AUR, along with latest jupyter.

When running with the SageMath 8.3 kernel in Jupyter notebook and Jupyter lab, equations are printed with MathJax if I either have:

%display latex

or use the pretty_print function.

This does not happen in nteract: the above run without error, but do not output anything. That is, there is no output to the cell, when there should be a MathJax equation. Likewise, nteract does not display equations in existing sage notebooks.

To reproduce: start SageMath kernel in nteract, and run:

%display latex
x^2

Nothing is shown. When running a notebook without %display latex, a non-latex output x^2 is shown.

Furthermore: the notebook created by nteract doesn't show the equations when displayed in a standard jupyter notebook. I need to re-run the cell for the math to show up.

I have attached a zip file with 2 notebooks: notebooks.zip

  1. nteract.ipynb - the notebook created by nteract which does not display the math in nteract nor jupyter itself.
  2. notebook.ipynb - the same notebook which had the cell re-run in jupyter notebook. The math now shows in jupyter, but not in nteract.

What's weird is that I can't see any reason for this in the notebook code itself- both seem to be identical in cell contents...

@dkumor dkumor changed the title SageMath LaTex display SageMath: LaTex rendering of output not showing in nteract Oct 1, 2018
@willingc
Copy link
Member

Hi @dkumor,

Thanks for the report. The latest release is 0.12.3. If you are able to try with the latest release, please let us know if this still is happening.

@willingc willingc added the workflow: reproduce Issue needs to be reproduced to troubleshoot label Dec 18, 2018
@dkumor
Copy link
Author

dkumor commented Dec 21, 2018

I have tried with the latest release of nteract and SageMath 8.4 - there was no change in the issue. The same thing happens on two separate machines (both running arch).

I have since noticed that JupyterLab needs to re-run cells for existing math to appear. nteract does not show the math at all, no matter what is done.

@willingc
Copy link
Member

Thanks for giving it a try and sharing your results.

@willingc willingc added bug \LaTeX and removed workflow: reproduce Issue needs to be reproduced to troubleshoot labels Dec 21, 2018
@stale
Copy link

stale bot commented Oct 17, 2019

This issue hasn't had any activity on it in the last 90 days. Unfortunately we don't get around to dealing with every issue that is opened. Instead of leaving issues open we're seeking to be transparent by closing issues that aren't being prioritized. If no other activity happens on this issue in one week, it will be closed.
It's more than likely that just by me posting about this, the maintainers will take a closer look at these long forgotten issues to help evaluate what to do next.
If you would like to see this issue get prioritized over others, there are multiple avenues 🗓:

  • Ask how you can help with this issue 👩🏿‍💻👨🏻‍💻
  • Help solve other issues the team is currently working on 👨🏾‍💻👩🏼‍💻
  • Donate to nteract so we can support developers to work on these features and bugs more regularly 💰🕐

Thank you!

@stale stale bot added the stale workflow: stale issue label Oct 17, 2019
@stale stale bot closed this as completed Nov 17, 2019
@captainsafia
Copy link
Member

Re-opening this issue as it still occurs.

Upon further inspection, it seems that the issue with it not displaying at all might be related to the use of the %display magic.

When I tried the following, I was able to see the output.

%%latex
x^2

However, even though it was rendered with our MathJax component, it was still not displayed in formatted LaTeX. I suspect this is due to the MathJax component not working.

We'll need to get a test notebook with more LaTeX examples and run more validations to see what is going on here.

@captainsafia captainsafia reopened this Nov 27, 2019
@stale stale bot removed the stale workflow: stale issue label Nov 27, 2019
@willingc
Copy link
Member

@captainsafia Using the code in the open PR, I was able to get rendering reliably in code cells for latex with the magic.

Output using an input code cell:
Screen Shot 2020-05-26 at 1 41 34 PM

Ouput using an input markdown cell
Screen Shot 2020-05-26 at 1 42 02 PM

Screen Shot 2020-05-26 at 1 45 14 PM

Console error
Screen Shot 2020-05-26 at 1 45 43 PM

@captainsafia
Copy link
Member

Interesting. I mentioned in the issue but we probably want to migrate that fix over to the mathjax-electron repo to bring this improvement to the desktop app.

Thanks for digging into this!

@willingc
Copy link
Member

willingc commented Dec 7, 2020

Should be closed by #5399

@smjochum
Copy link

I am having this issue on Mac OS.

For a work around I am using either %display unicode_art or %display ascii_art.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants