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

Feature Request: Save As (latex, html,..etc) as a menu option in Notebook rather than explicit need to invoke nbconvert #3402

Closed
nipunbatra opened this issue Jun 5, 2013 · 22 comments

Comments

@nipunbatra
Copy link

No description provided.

@Carreau
Copy link
Member

Carreau commented Jun 5, 2013

Don't worry, that's (more or less) the all point of 1.0 release.

The time to do it is starting to be tight, and we need nbconvert to be finished and tested to do it.

@Norfeldt
Copy link

Norfeldt commented Aug 6, 2013

Where can I find the most current guide on how to use nbconvert to get my notebooks as pdf files ?

@Carreau
Copy link
Member

Carreau commented Aug 6, 2013

here, rendered as html, in our dev doc.
here in github repository.

Comment /Questions (and fixes) welcomed.

@Norfeldt
Copy link

Norfeldt commented Aug 6, 2013

That was a fast response! Thank you.

I tried "ipython nbconvert --to latex myNotebook.ipynb" but got the error that some pandoc is missing..

Bonus info:
I just upgraded to the newest RC by
pip install http://archive.ipython.org/testing/1.0.0/ipython-1.0.0-rc1.tar.gz

I'm trying to install the pandoc manually now... I just thought that it came shipped with IPython nbconvert

@Carreau
Copy link
Member

Carreau commented Aug 6, 2013

I guess you need to install pandoc... which not a python dependency so pip cannot install it.

@Norfeldt
Copy link

Norfeldt commented Aug 6, 2013

I installed the pandoc and had to restart windows in order for ipython to find it.

A .tex was succesfull genereated by the call
ipython nbconvert --to latex myNotebook.ipynb

But using this call
ipython nbconvert --to latex --post PDF myNotebook.ipynb

gave me this error:

[NbConvertApp] Converting notebook myNotebook.ipynb to latex
[NbConvertApp] Support files will be in myNotebook_files\
[NbConvertApp] Loaded template latex_article.tplx
[NbConvertApp] Writing 116664 bytes to .\myNotebook.tex
[NbConvertApp] Building PDF: pdflatex .\myNotebook.tex
This is pdfTeX, Version 3.1415926-2.4-1.40.13 (MiKTeX 2.9)
entering extended mode
(C:\Users\Norfeldt\Desktop\myNotebook.tex
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, afrikaans, ancientgreek, ar
abic, armenian, assamese, basque, bengali, bokmal, bulgarian, catalan, coptic,
croatian, czech, danish, dutch, esperanto, estonian, farsi, finnish, french, ga
lician, german, german-x-2012-05-30, greek, gujarati, hindi, hungarian, iceland
ic, indonesian, interlingua, irish, italian, kannada, kurmanji, latin, latvian,
lithuanian, malayalam, marathi, mongolian, mongolianlmc, monogreek, ngerman, n
german-x-2012-05-30, nynorsk, oriya, panjabi, pinyin, polish, portuguese, roman
ian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedish, swissgerm
an, tamil, telugu, turkish, turkmen, ukenglish, ukrainian, uppersorbian, usengl
ishmax, welsh, loaded.
! Undefined control sequence.
<argument> C:\Python
27\lib \site -packages\sphinx \texinputs /sphinxhowto
l.11

?

@jakobgager
Copy link
Contributor

There is currently an issue with escaping backslashes during the conversion to tex see #3588.
Seems like you met it 😕
I just wonder why this happens in the preamble as well (line 11) ...

Moreover, there is a mixture of / and \ in this path
C:\Python27\lib\site-packages\sphinx\texinputs/sphinxhowto

@Norfeldt
Copy link

Norfeldt commented Aug 6, 2013

How do I fix it?

The ? is like waiting for an input so I pasted the real address to sphinxhowto

sphinx

I tried both the ENTER, R and Q but no luck

it still gives the ! Undefined control sequence.

@jakobgager
Copy link
Contributor

You can try to change the preamble line in the tex file to point to the correct address (only as a workaround).
I have no Win system to try, sorry.

@jakobgager
Copy link
Contributor

I found a Win and you can solve your problem (no fix!) by changing the \s in the paths in the .tex file to /.
A respective fix was merged as #3888 - however in current master only - not in rc1.
You can upgrade (pip install https://github.com/ipython/ipython/archive/master.zip) and test it.

@Norfeldt
Copy link

Norfeldt commented Aug 6, 2013

Thank you jakob!

It is working now.. It downloaded a lot of libs and gave me a bunch of missing } which I just forced to ignored by typing Q and ENTER.

I can see now that the nbconvert is not fully finished since a lot of text spans out of the code blocks and the caption images does not display..

@jakobgager
Copy link
Contributor

Caption images? Can you post your notebook somewhere?

@Norfeldt
Copy link

Norfeldt commented Aug 6, 2013

Not this one.. sorry

But I'll make one I can post as an example - it will however have to wait until tomorrow

@ivanov
Copy link
Member

ivanov commented Aug 6, 2013

@Norfeldt actually, the fix for the issue you were seeing on windows was addressed in #3901. You can see here that it was just a one line code change, so you can apply the fix yourself, but it is now in master.

@Norfeldt
Copy link

Norfeldt commented Aug 7, 2013

@ivanov thank you.. I however don't know how to do this.. Do I change it in the python27 directory or do I have to change it in the downloaded zip I used for pipand then run it again pip install local/dir/to/manually/adjusted/source/code/master.zip

@jakobgager and @Carreau I tried opening the notebook with the 1.0.0-dev (pip install https://github.com/ipython/ipython/archive/master.zip) but then I got the white screen of dead again in the browser when starting the notebook (ipython notebook).

I then reversed "back" to the RC pip install http://archive.ipython.org/testing/1.0.0/ipython-1.0.0-rc1.zip

I have made you an example notebook which you can download from here:
https://dl.dropboxusercontent.com/u/3216968/nbConvertExample.zip

It should look like this:


part1
part 2


@Carreau
Copy link
Member

Carreau commented Aug 7, 2013

Ah, the images is referenced from a markdown cell, and removeFakeFiles seem not to be applied on it.

With which version of IPython did you create this notebook ? dev ? Because some things seems strange in the structure.

@Norfeldt
Copy link

Norfeldt commented Aug 7, 2013

I used the RC1

What seems strange in the structure?

Venlig Hilsen / Yours Sincerely
Lasse Nørfeldt

Ah, the images is referenced from a markdown cell, and removeFakeFilesseem not to be applied on it.

With which version of IPython did you create this notebook ? dev ? Because
some things seems strange in the structure.


Reply to this email directly or view it on GitHubhttps://github.com//issues/3402#issuecomment-22266989
.

@Carreau
Copy link
Member

Carreau commented Aug 7, 2013

cell sources are one line (looks like notebook v2, IPython 0.12):

"source": "##It's not all perfect\n**Yet!** But it will be at some point because the IPython community rocks!\n\nBut until then we have to learn some ***work arounds*** to archive some trivial tasks.\n\nOne example of this is how to get user input. I hope that this in the future can be done interactively and perhaps by some html popups. But for now I have found the following solution to work for me"

Wherease it should be a list IIUC.

source:[
      "##It's not all perfect\n",
      "**Yet!** But it will be at some point because the IPython community rocks!\n",
      "\n",
      "But until then we have to learn some ***work arounds*** to archive some trivial tasks.\n",
      "\n",
      "One example of this is how to get user input. I hope that this in the future can be done interactively and perhaps by some html popups. But for now I have found the following solution to work for me"
]

@Norfeldt
Copy link

@Carreau it's a bit hard being a windows 7 and IPython user at the same time.. But even though I have a lot of problems with IPython I still believe that it worth the hassle. I have no idea why my Notebook behaves as 0.12.. I started installing 0.13.X and now upgraded to the RC1.
I initially got my IPython from the Python(x,y) distribution and then upgraded things like ipython and numpy manually

@Carreau
Copy link
Member

Carreau commented Aug 10, 2013

it's a bit hard being a windows 7 and IPython user at the same time..

Yes, I understand. We also have so few tester on window that it is also hard to help.

upgraded to the RC1.

Final version has been released.

I initially got my IPython from the Python(x,y) distribution and then upgraded things like ipython and numpy manually

Have you tried things like canopy/anaconda ?

@Norfeldt
Copy link

My experience with getting it through Enthought is not so good. In the beginning I found it difficult to find the free version and I had do a lot of troubles installing and 'patching' things to work the way I wanted it to.

One thing I especially like about the pythonxy dist is that it makes all my python files executable and adds things to the windows environment like right-click start ipython or console in this directory.

@filmor
Copy link
Contributor

filmor commented Aug 11, 2013

I can recommend the standard windows Python from python.org in combination with http://www.lfd.uci.edu/~gohlke/pythonlibs/. I have this running in my private and a production environment pretty much flawlessly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants