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

serve like option for nbconvert --to latex #4291

Closed
jakobgager opened this issue Sep 27, 2013 · 10 comments
Closed

serve like option for nbconvert --to latex #4291

jakobgager opened this issue Sep 27, 2013 · 10 comments
Milestone

Comments

@jakobgager
Copy link
Contributor

When converting notebooks to latex and using the --post pdf I typically miss a serve like option which opens the compiled pdf directly. In about 100% of the cases I subsequently open the pdf to check it.
I just wonder if others have a similar feeling?

@jdfreder
Copy link
Member

I share that feeling. Allowing a --serve flag when --post PDF is used would require us to allow the user to specify an array of post processors.

@Carreau
Copy link
Member

Carreau commented Sep 27, 2013

I think that --post=OpenPDF would (generaly) imply --post PDF

@jdfreder
Copy link
Member

--post=OpenPDF

That's a good idea

@jakobgager
Copy link
Contributor Author

I agree with Matthias that a serve call would imply a pdf call.
I think the already used --post=serve would fit quite well, but I'm happy with --post=OpenPDF

@Carreau
Copy link
Member

Carreau commented Sep 27, 2013

merging the 2 behaviour in --post=serve would be difficult I think.

@jakobgager
Copy link
Contributor Author

Currently I have no idea of the internals of the postprocessor so your feelings are highly appreciated.
I thought it would be something like (in pseudo code)

if '--to latex':
    compile (use methods from --post pdf)
    open pdf
else:
    current implementation

@jdfreder
Copy link
Member

Currently I have no idea of the internals of the postprocessor

It doesn't have access to the host exporter module name. See https://github.com/ipython/ipython/blob/master/IPython/nbconvert/exporters/templateexporter.py#L179
to understand how --to and --template are used.

and
https://github.com/ipython/ipython/blob/master/IPython/nbconvert/nbconvertapp.py#L254
to understand how the post processor is constructed.

@jdfreder
Copy link
Member

Forgot to mention
https://github.com/ipython/ipython/blob/master/IPython/nbconvert/exporters/export.py#L158
to see how --to influences what exporter class is used.

@minrk
Copy link
Member

minrk commented Sep 27, 2013

I would add this as a bool configurable trait on PDFPostprocessor, if anything. Not a new one, and no command-line alias.

@jakobgager
Copy link
Contributor Author

Great idea! 👍

@minrk minrk closed this as completed in 187d64f Oct 6, 2013
@minrk minrk added this to the 2.0 milestone Mar 26, 2014
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
Call PDF viewer after latex compiling (nbconvert)

Add a configurable to open the pdf after compiling.
Uses the default application.

closes ipython#4291
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

No branches or pull requests

4 participants