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

Additional Files not found when running pdflatex in PDFExporter #52

Open
stonefly opened this issue Jun 25, 2015 · 6 comments
Open

Additional Files not found when running pdflatex in PDFExporter #52

stonefly opened this issue Jun 25, 2015 · 6 comments
Labels
format:LaTeX pertains to exporting to the LaTeX format

Comments

@stonefly
Copy link

I recently encounter a problem that does not happen when I use ipython 2.x.

I convert ipynb to pdf using my own template which refers to additional files like logo.eps etc.

Before I always create my own working directory and put all files (ipynb file, tplx file, eps file, etc) under it and run nbconvert. It works fine.

However it breaks recently due to that in the new PDFExporter, the pdflatex runs in another temporary directory where only the tex files and the output files along with the latex generations are written to that directory. So I will get a '***' File Not Found error finally because the pdflatex cannot find the 'eps' file.

In contrast, in the old days, the 'PDF' postprocessor (deprecated now) did run in-place so there was no such problems.

Do we have an elegant way to specify additional files that should run with pdflatex? I found it's not obvious to insert the files i need in resources['outputs'], although it's not impossible

nbconvert_bug

@takluyver
Copy link
Member

If you're customising PDF creation that much, it may be simpler to use --to latex and then build the PDF yourself using pdflatex.

@stonefly
Copy link
Author

Yes, I use this way to fix it currently.

I did not do many customizations, I only use a customized template and a customized logo.

Any reasons that we have to use another temporary folder here? It breaks something that used to work.

I think the users should expect --to=pdf should be equivlent to --to=latex and then run pdflatex 3 times. But now they will behave differently.

@takluyver
Copy link
Member

If you just want the PDF, you shouldn't get additional files written in your working directory by the implementation of how the PDF is generated. It's encapsulation - intermediate files are written somewhere where you don't see them. If you do want to modify things at that stage, e.g. to add another file at the latex level, it involves an extra step.

@stonefly
Copy link
Author

I agree that it's better to run pdflatex in a temporary directory to the oldways generate intermidiate files and then clean them. It's quite annoying that even you run pdflatex with -output-directory, it still generates some files in the current folder in some cases, quite annoying.

I am just thinking if i could specify files that I would like to have along with pdflatex in the PDFExport config? So that these files will be copied to the new temp directory.

Do you think this makes sense?

@takluyver
Copy link
Member

That sounds reasonable, though I haven't thought about it in much detail. Do you want to make a PR?

@stonefly
Copy link
Author

Sure, let me try.

Many thanks.

@takluyver takluyver added the format:LaTeX pertains to exporting to the LaTeX format label Jul 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
format:LaTeX pertains to exporting to the LaTeX format
Projects
None yet
Development

No branches or pull requests

2 participants