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

'header.tex' not found when running example #3

Open
ghost opened this issue Aug 31, 2016 · 3 comments
Open

'header.tex' not found when running example #3

ghost opened this issue Aug 31, 2016 · 3 comments

Comments

@ghost
Copy link

ghost commented Aug 31, 2016

I'm attempting to run the script using the 'example.tex' file, but it errors out when pdflatex attempts to convert the equations. I've tried this on 2 OS's (OS X and Fedora 20), and I get the same error. Any idea why? Am I missing a TeXLive dependency? Full error output is below.

[username@localhost beamer2pptx-master]$ python beamer2pptx.py
add slide First Slide (1 over 4)
add slide Slide with images (2 over 4)
add slide Equations (3 over 4)
This is pdfTeX, Version 3.1415926-2.6-1.40.14 (TeX Live 2014/dev)
restricted \write18 enabled.
entering extended mode
(./tmp_equation.tex
LaTeX2e <2011/06/27>
Babel <3.9h> and hyphenation patterns for 2 languages loaded.
(/usr/share/texlive/texmf-dist/tex/latex/standalone/standalone.cls
Document Class: standalone 2012/09/15 v1.1b Class to compile TeX sub-files stan
dalone
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifluatex.sty)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifpdf.sty)
(/usr/share/texlive/texmf-dist/tex/generic/ifxetex/ifxetex.sty)
(/usr/share/texlive/texmf-dist/tex/latex/xkeyval/xkeyval.sty
(/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkeyval.tex
(/usr/share/texlive/texmf-dist/tex/generic/xkeyval/keyval.tex)))
(/usr/share/texlive/texmf-dist/tex/latex/standalone/standalone.cfg)
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo))
(/usr/share/texlive/texmf-dist/tex/latex/preview/preview.sty
(/usr/share/texlive/texmf-dist/tex/latex/preview/prtightpage.def)))

! LaTeX Error: File `header.tex' not found.

Type X to quit or to proceed,
or enter new name. (Default extension: tex)

Enter file name:

@martinGithub
Copy link
Owner

i made a change , does it work now ?

@ghost
Copy link
Author

ghost commented Sep 1, 2016

Partially. The 'header.tex' error is gone now, but now I get another error stating that it can't find 'equations/eqn1.png' (below is the output). I was able to fix the problem by replacing lines 131 and 142 with file=os.path.join('eqn%d.png'%ideqn), so the equation .png's are just placed in the working directory. That or I can just manually make a directory called 'equations' and leave the script as-is. Thanks for putting this code out on github, I'm sure its going to save me quite a bit of time in the future! --David

~/python/beamer2pptx$ python beamer2pptx.py
add slide First Slide (1 over 4)
add slide Slide with images (2 over 4)
add slide Equations (3 over 4)
This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015/MacPorts 2015_3) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
(./tmp_equation.tex
LaTeX2e <2015/01/01>
Babel <3.9l> and hyphenation patterns for 2 languages loaded.
(/opt/local/share/texmf-texlive/tex/latex/standalone/standalone.cls
Document Class: standalone 2012/09/15 v1.1b Class to compile TeX sub-files stan
dalone
(/opt/local/share/texmf-texlive/tex/generic/oberdiek/ifluatex.sty)
(/opt/local/share/texmf-texlive/tex/generic/oberdiek/ifpdf.sty)
(/opt/local/share/texmf-texlive/tex/generic/ifxetex/ifxetex.sty)
(/opt/local/share/texmf-texlive/tex/latex/xkeyval/xkeyval.sty
(/opt/local/share/texmf-texlive/tex/generic/xkeyval/xkeyval.tex
(/opt/local/share/texmf-texlive/tex/generic/xkeyval/xkvutils.tex
(/opt/local/share/texmf-texlive/tex/generic/xkeyval/keyval.tex))))
(/opt/local/share/texmf-texlive/tex/latex/standalone/standalone.cfg)
(/opt/local/share/texmf-texlive/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/opt/local/share/texmf-texlive/tex/latex/base/size10.clo))
(/opt/local/share/texmf-texlive/tex/latex/preview/preview.sty
(/opt/local/share/texmf-texlive/tex/latex/preview/prtightpage.def)))
No file tmp_equation.aux.
Preview: Fontsize 10pt
Preview: PDFoutput 1
Preview: Tightpage 0 0 0 0
1{/opt/local/var/db/texmf/fonts/map/pdftex/updmap/pdftex.map} )</opt/local/share/texmf-texlive/fonts/type1/public/amsfon
ts/cm/cmex10.pfb></opt/local/share/texmf-texlive/fonts/type1/public/amsfonts/cm
/cmmi10.pfb></opt/local/share/texmf-texlive/fonts/type1/public/amsfonts/cm/cmmi
7.pfb></opt/local/share/texmf-texlive/fonts/type1/public/amsfonts/cm/cmr10.pfb>
</opt/local/share/texmf-texlive/fonts/type1/public/amsfonts/cm/cmr7.pfb></opt/l
ocal/share/texmf-texlive/fonts/type1/public/amsfonts/cm/cmsy10.pfb>
Output written on tmp_equation.pdf (1 page, 45340 bytes).
Transcript written on tmp_equation.log.
convert: unable to open image equations/eqn1.png': No such file or directory @ error/blob.c/OpenBlob/2709. convert: WriteBlob Failedequations/eqn1.png' @ error/png.c/MagickPNGErrorHandler/1645.
Traceback (most recent call last):
File "beamer2pptx.py", line 148, in
pic = newslide.shapes.add_picture(file, left, top,height=height)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pptx/shapes/shapetree.py", line 321, in add_picture
image_part, rId = self.part.get_or_add_image_part(image_file)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pptx/parts/slide.py", line 40, in get_or_add_image_part
image_part = self._package.get_or_add_image_part(image_file)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pptx/package.py", line 49, in get_or_add_image_part
return self._image_parts.get_or_add_image_part(image_file)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pptx/package.py", line 119, in get_or_add_image_part
image = Image.from_file(image_file)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pptx/parts/image.py", line 166, in from_file
with open(image_file, 'rb') as f:
IOError: [Errno 2] No such file or directory: 'equations/eqn1.png'

@martinGithub
Copy link
Owner

i added two lines to create the "equations" directory if it doesn't exists

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

1 participant