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

exporting pdf from notebook #519

Closed
RafalSkolasinski opened this issue Feb 25, 2016 · 10 comments
Closed

exporting pdf from notebook #519

RafalSkolasinski opened this issue Feb 25, 2016 · 10 comments
Assignees
Labels
status: ready tag: API tag: notebook type: bug Something isn't correct or isn't working
Milestone

Comments

@RafalSkolasinski
Copy link

If you currently try to export pdf (holoviews==1.4.3) image to pdf with

%%output filename="test" fig="pdf" dpi=140
# some code in here that normally display image in notebook

it export pdf correctly but screws up outputs in notebook, even for other cells.

P.S. Please feel free to modify description or title of the issue

@philippjfr
Copy link
Member

Thanks for filing the issue, basically embedding a PDF viewer in the notebook is probably not a good idea and should be disabled. I'd suggest retaining PDF as an export format but disable displaying it in the notebook.

@jlstevens
Copy link
Contributor

I would hope the need for PDF is somewhat alleviated now that nbconvert works better with HoloViews. You should be able to export notebooks to PDF using nbconvert more easily since PR #355 was merged.

@RafalSkolasinski Would this be an acceptable solution for you? As Philipp says, PDF support in the notebook itself is tricky and unlikely to ever work properly. For that reason, I would seriously consider deprecating it.

@philippjfr
Copy link
Member

For the time being I've recommended using the renderer directly like this:

hv.Store.renderers['matplotlib'].save(obj, filename, 'pdf')

@philippjfr philippjfr added type: bug Something isn't correct or isn't working tag: API tag: notebook labels Feb 25, 2016
@jlstevens
Copy link
Contributor

@philippjfr Maybe that is the best solution then? Disable pdf in the output magic but leave support at the renderer level? Certainly makes sense to me!

@jbednar
Copy link
Member

jbednar commented Feb 25, 2016

I don't suppose %%output could support saving the output in PDF and displaying it in some other format in the notebook? That seems like something people will very often want, i.e. to be able to work nicely with figures within the notebook, but also to save an always-up-to-date PDF copy so that it will be found by LaTeX or other text-preparation programs for writing papers or reports.

@philippjfr philippjfr added this to the 1.4.4 milestone Feb 25, 2016
@RafalSkolasinski
Copy link
Author

From my point of view it would be nice to have support of saving to pdf
(through magic), that would work exactly as saving to png, but not break
whole notebook.

On 25 February 2016 at 21:19, James A. Bednar notifications@github.com
wrote:

I don't suppose %%output could support saving the output in PDF and
displaying it in some other format in the notebook? That seems like
something people will very often want, i.e. to be able to work nicely
within figures in the notebook, but also to save an always-up-to-date PDF
copy so that it will be found by LaTeX or other text-preparation programs
for writing papers or reports.


Reply to this email directly or view it on GitHub
#519 (comment).

@jlstevens
Copy link
Contributor

@RafalSkolasinski Agreed! The problem we've never found a decent solution for inlining PDF output in the browser. If you have any suggestions, we'll definitely consider them.

@RafalSkolasinski
Copy link
Author

Hmmm... Maybe separate magic for exporting to file that wouldn't influence
normal in line output?
On Feb 26, 2016 13:19, "Jean-Luc Stevens" notifications@github.com wrote:

@RafalSkolasinski https://github.com/RafalSkolasinski Agreed! The
problem we've never found a decent solution for inlining PDF output in the
browser. If you have any suggestions, we'll definitely consider them.


Reply to this email directly or view it on GitHub
#519 (comment).

@jlstevens
Copy link
Contributor

It has been a while since I last tested it but the %%output magic has a filename argument. I can't remember how it determines the filetype but I imaging it could do it via the extension. That way if you specify .pdf it would output it as such. Alternatively, have you looked into the notebook archive (documented in the Exporting tutorial)? You could have a renderer exporter for pdfs...

@jbednar
Copy link
Member

jbednar commented Feb 26, 2016

I don't think inlining PDF into the browser is the issue here, just the ability to get a PDF copy while seeing some version of the figure in the notebook (whether PNG or SVG). The notebook archive support should achieve this, but it is a fairly heavy weight way to do so if the cell output magic could do it...

@philippjfr philippjfr modified the milestones: v1.5.0, 1.4.4 Apr 20, 2016
@philippjfr philippjfr modified the milestones: v1.6.0, v1.5.0 Apr 29, 2016
@philippjfr philippjfr self-assigned this Mar 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: ready tag: API tag: notebook type: bug Something isn't correct or isn't working
Projects
None yet
Development

No branches or pull requests

4 participants