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

Expose the Latex PDF exporter #16

Merged
merged 6 commits into from
May 1, 2016
Merged

Expose the Latex PDF exporter #16

merged 6 commits into from
May 1, 2016

Conversation

acspike
Copy link
Contributor

@acspike acspike commented Apr 26, 2016

I was looking to add code and prompt hiding to the Latex PDF output included with Jupyter Notebook. Your extension does this nicely, but for some reason doesn't expose the functionality. I've found that the Latex output is a bit nicer than the HTML based output for my uses. It doesn't break pages in the middle of images leaving half of the image on each page as can happen with the HTML based PDF output.

@kirbs-
Copy link
Owner

kirbs- commented Apr 26, 2016

I'm fine with this, but we need to use a different icon so users can tell the difference.
Edit: Also the Latex PDF export isn't quite done yet. I think it doesn't respect any hide code selections right now.

@acspike
Copy link
Contributor Author

acspike commented Apr 26, 2016

Do you have a preference of icons?

In my testing, the latex PDF export did hide code.

I've also got a commit waiting that allows hiding outputs. Which seems like a bad idea on the outset but I had a cell with undesirable outputs and streams that I couldn't silence.

@kirbs-
Copy link
Owner

kirbs- commented Apr 26, 2016

Do you have a preference of icons?

No preference. I'm currently only using those that ship with Jupyter; Font Awesome 4.2 I think.

In my testing, the latex PDF export did hide code.

Might be the prompt hiding that doesn't work in the latex PDF exporter.

I've also got a commit waiting that allows hiding outputs. Which seems like a bad idea on the outset but I had a cell with undesirable outputs and streams that I couldn't silence.

Great! I've been meaning to do this too.

@acspike
Copy link
Contributor Author

acspike commented Apr 26, 2016

I've changed it to the generic file-o icon.

Actually, prompt hiding seemed to work too.

kirbs- added a commit that referenced this pull request Apr 27, 2016
kirbs- added a commit that referenced this pull request Apr 27, 2016
@kirbs-
Copy link
Owner

kirbs- commented Apr 27, 2016

I'm going to hold off merging this with the master branch until the Latex PDF exporter template is fixed. When ever Hide code is selected, the exporter hides the code and the output for the cell.

@acspike
Copy link
Contributor Author

acspike commented Apr 27, 2016

Would you mind if I merge the hide-ouput change set into this pull request? I know it is more proper to separate changes, but it is going to be significantly easier for me to work on the template in view of the final result, rather than trying to stage things.

@acspike
Copy link
Contributor Author

acspike commented Apr 27, 2016

I believe the latest revision handles this case properly.

Question: Currently code and prompts are hidden independently. Would it make sense that whenever hiding a particular code cell the associated prompt is also hidden? I'm not sure of the use case for the current behavior.

@kirbs-
Copy link
Owner

kirbs- commented Apr 27, 2016

You can merge changes into one PR. Just pull down any changes from the dev branch. I've patched several bugs since the last commit on master.

My original intention was to have the hide code toolbar button toggle prompts and code together. Then provide more granular customization through the cell toolbar. However, the main toolbar button status isn't persisted in the notebook's metadata. This is another item on the to do list.

@acspike
Copy link
Contributor Author

acspike commented Apr 27, 2016

The current state of the branch should allow a prompt to appear without its associated code or output and vice versa. I think this more closely follows the behavior you had implemented for the HTML output.

Just to be clear, the desired behavior is that the Hide/Show Code button in the toolbar immediately hide all code and prompts (and save the status in the notebook metadata to be reflected in downloads). Clicking the button a second time shows elements again, but only elements that have not been hidden individually by a cell toolbar checkbox. Does that sound about right?

@kirbs-
Copy link
Owner

kirbs- commented Apr 28, 2016

The current state of the branch should allow a prompt to appear without its associated code or output and vice versa. I think this more closely follows the behavior you had implemented for the HTML output.

Sounds good, I'll take a look. I'd want to keep the behavior consistent between all exporters.

Just to be clear, the desired behavior is that the Hide/Show Code button in the toolbar immediately hide all code and prompts (and save the status in the notebook metadata to be reflected in downloads). Clicking the button a second time shows elements again, but only elements that have not been hidden individually by a cell toolbar checkbox. Does that sound about right?

Correct, the button is meant as an "easy" button if a user wants to hide everything.

I'll review the updates and try to get everything documented and packaged this weekend. Thanks for contributing!

kirbs- added a commit that referenced this pull request Apr 29, 2016
@kirbs- kirbs- merged commit 8216783 into kirbs-:master May 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants