I know that there are threads related to this, but it is really painful...
I would like to insert images saved from a tool into latex.
The images could be saved in any format of the followings: PNG, JPEG, PDF, GIF, BMP. The choice is totally up to me.
The problem is I tried
\usepackage{graphicx}
...
\begin{figure}
\includegraphics{image.suffix}
\end{figure}
The compilation gives me an error ! LaTeX Error: Cannot determine size of graphic in image.suffix (no Bound ingBox).
Someone says it is due to dvips. I do have dvips in my makefile, but I don't know how to remove it; Someone says it is pdflatex which should be used, but I don't know how to modify makefile to do so.
EPS= $(FGS:%=%.eps)
%.eps: %.tex $(MACROS)
latex $< && dvips -t letter -z -P pdf -o ${<:%.tex=%.ps} ${<:%.tex=%.dvi} && gs -q -dNOPAUSE -dBATCH -sDEVICE=bbox ${<:%.tex=%.ps} 2> ${<:%.tex=%.bb} && cat ${<:%.tex=%.ps} | perl -ne 'if (/BoundingBox/) { open BB, "${<:%.tex=%.bb}" or die; print <BB>; close BB; } else { print; }' > $@
all: paper.pdf eps
regen: $(EPS)
make ALLDEPS=1
eps: $(EPS)
SRC= fonts.tex paper.bib macros-paper.tex packages.tex
paper.pdf: paper.tex $(SRC) $(EPS)
latex paper.tex && bibtex --min-crossrefs=500 paper && latex paper.tex && latex paper.tex && dvips paper.dvi -o paper.ps && ps2pdf paper.ps paper.pdf
Could anyone help?
Update1:
Following the comment of @nickie , I modified makefile including all about epstopdf, the compilation still gave me an error:
! Package pdftex.def Error: File 'fg1-eps-converted-to.pdf' not found. for the tex \includegraphics[scale=1]{fg1}, where fg1.tex is supposed to generate a figure by pspicture.
Does anyone have any idea?
latexyou can only use EPS. – egreg Nov 09 '13 at 13:32makefile? – SoftTimur Nov 09 '13 at 13:34pdflatex; nodvipsandgsare required. – egreg Nov 09 '13 at 13:36texwhich generateepsthat are inserted topaper.tex. I don't know ifpdflatexcould handle this and what/where to remove and add inmakefile... – SoftTimur Nov 09 '13 at 13:59