-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Feature Request: More control of Notebook PDF Export #5199
Comments
The export to pdf is done with nbconvert. In order to change things like fonts, page layout, etc., one needs to create a nbconvert template. This entails using jinja to template LaTeX. To do this in a general manner is quite difficult. Especially for fonts. Unfortunately, I think that something this general is out of sight (but I'm not a jlab dev so...). (I suppose someone could attempt to make a jlab extension that automatically makes templates though that may have it's own complications and restrictions) It is possible to create your own template with your style preferences and then set the export within jlab to use it. You can see an example of this over at my repo. For point 1, if jlab uses meta-data to store whether a cell is collapsed then it wouldn't be to hard to implement an nbconvert preprocessor to do this. (We probably don't need a new preprocessor; it may just be a case of using an existing one.) |
In terms of reports and not showing the code. Nbconvert is adding a nice shortcut for this from the command line hopefully in the next release. If you want more control over nbconvert you'll have to use the command line interface and friends. If you have more questions about using nbconvert, I'd be happy to assist as I've spent a lot of time working with nbconvert and exporting to PDFs. We could find a way to communicate outside of GitHub or ask a question over in either my repo or in nbconvert |
Lantern adds it right under the current export menu, email uses it to email pdf of the notebook. |
Wow! Awesome stuff! It'd be cool if there was a selector (or cell magic) to indicate which cells should/shouldn't be rendered. |
Yes, you can absolutely add new exporters to the menu. It shouldn't be to hard to subclass the pdfexporter to remove collapsed cells be default and/or all code cells (leaving the output). Both of these should even be possible without a custom exporter. It would just require changing the Jupyter config file. We just wouldn't want to add a load of exporters of every possible combination of use cases. Now that I think about it. It would be possible to click "export to pdf" and have it open a little window with options to enable/disable different preprocessors. That wouldn't let one use different fonts/page sizes, but it would still give a load of options. Extension idea.... |
Is this still open in light of #5015? I am trying to acchieve the --no-input nbconvert option from the jupyterlab "export as" menu. |
I opened #8629. |
referencing this here, adding two "no code" exporters: https://github.com/timkpaine/jupyterlab_nbconvert_nocode |
@t-makaro jupyterlab_email does this, it has some preconfigured templates and it lets you pick and choose options. Its a little annoying to do and a little tricky to make extensible. |
It would be useful if more control was possible when exporting a notebook as PDF. For example,
EDIT: Stream of thought feature additions...
enscript -2Gr
)If there is an export control/config file somewhere, I wouldn't mind trying to edit it as an interim step.
I'd like to create PDF reports where almost exclusively the markdown and plots are rendered with a bunch of Julia code under the hood (not rendered in the PDF) that generates the plots.
The text was updated successfully, but these errors were encountered: