Opened 4 years ago

Last modified 2 years ago

#26101 new enhancement

Inline `view` in the Jupyter notebook

Reported by: nthiery Owned by:
Priority: major Milestone: sage-8.4
Component: notebook Keywords:
Cc: zerline, embray, jdemeyer Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by kcrisman)

In the Jupyter notebook, view(...) currently displays the pdf in an external pdf viewer, launched from the server. An inline view as in sagenb would be nicer and would work remotely as well.

  • Recycle the logic to produce the pdf from the existing view
  • Convert the pdf to svg
  • Have view return a Widget displaying that SVG

As a bonus, one could use view to produce widgets to be included into larger widgets. If we insist that view should return None and rather display the svg as a side effect, it would be useful to expose the functionality latex->Jupyter widget one way or the other.

Part of #29889.

Change History (6)

comment:1 Changed 4 years ago by nthiery

Viviane has experimental code doing that, though going through png, therefore with quality loss:

comment:2 Changed 4 years ago by nthiery

  • Cc zerline embray jdemeyer added

comment:3 Changed 4 years ago by embray

The IPython display formatters supposedly support PDF as a data type:

I'm not sure exactly what it does with PDFs though. For certain objects (e.g. graphs) going directly to SVG and outputting that (or a widget for something more sophisticated) would also make sense.

comment:4 Changed 4 years ago by nthiery

Ah, good to know. Thanks!

This prompted me to do a search, and the IFrame trick suggested below may be relevant:

(yeah, I know, I should be writing my reports instead ...)

comment:5 Changed 4 years ago by slabbe

I wrote some code during the last year in my optional package so that tikzpicture gets displayed inline in the jupyter notebook:

comment:6 Changed 2 years ago by kcrisman

  • Description modified (diff)
Note: See TracTickets for help on using tickets.