Graphics, Figures & TablesGraphics File Not Found

Information and discussion about graphics, figures & tables in LaTeX documents.
Borough
Posts: 6
Joined: Mon Aug 15, 2011 4:13 pm

Graphics File Not Found

Post by Borough »

I cannot get my pdf graphic files to show up. The file "graph1" is in the same folder as "Test.tex" so this shouldn't be the problem but I still get the error: "file "graph1" not found". This is my entire latex code:

Code: Select all

\documentclass[a4paper,10pt]{article}
\title{Test}

\usepackage{amssymb, amsmath, amsfonts, amsthm}
\usepackage{graphicx}

\begin{document}

\begin{figure}[h]
\centering
\includegraphics{graph1}
\end{figure}

\end{document}
Last edited by Stefan Kottwitz on Tue Aug 16, 2011 12:06 am, edited 2 times in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
Stefan Kottwitz
Site Admin
Posts: 10348
Joined: Mon Mar 10, 2008 9:44 pm

Re: Graphics File Not Found

Post by Stefan Kottwitz »

Hi Borough,

welcome to the board!

Does graph1 has the file name extension .pdf, i.e. is the name graph1.pdf? Do you use pdfLaTeX? Classic LaTeX in DVI mode cannot load PDF files, you have to use pdfLaTeX which means directly compiling to PDF, not over DVI/PS.

Stefan
LaTeX.org admin
Borough
Posts: 6
Joined: Mon Aug 15, 2011 4:13 pm

Re: Graphics File Not Found

Post by Borough »

Thanks for the reply.

The file name is graph1.pdf yes.

I use TexMakerX and have the quick build configured to PdfLaTeX + View PDF.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10348
Joined: Mon Mar 10, 2008 9:44 pm

Re: Graphics File Not Found

Post by Stefan Kottwitz »

If you would post the .log file here as attachment, I would have a look what may happened.

Stefan
LaTeX.org admin
Borough
Posts: 6
Joined: Mon Aug 15, 2011 4:13 pm

Re: Graphics File Not Found

Post by Borough »

I hope this is what you asked for.

LaTeX Warning: File `graph1.pdf' not found on input line 11.
! Package pdftex.def Error: File `graph1.pdf' not found.
See the pdftex.def package documentation for explanation.
Type H <return> for immediate help.
...
l.11 \includegraphics{graph1.pdf}
Using draft setting for this image.
Try typing <return> to proceed.
If that doesn't work, type X <return> to quit.
[1
{C:/ProgramData/MiKTeX/2.9/pdftex/config/pdftex.map}]
User avatar
Stefan Kottwitz
Site Admin
Posts: 10348
Joined: Mon Mar 10, 2008 9:44 pm

Graphics File Not Found

Post by Stefan Kottwitz »

Your code is

Code: Select all

\includegraphics{graph1}
however the error message shows

Code: Select all

l.11 \includegraphics{graph1.pdf}
That's not exactly the same. Perhaps try it again without the extention .pdf in \includegraphics.

Stefan
LaTeX.org admin
Borough
Posts: 6
Joined: Mon Aug 15, 2011 4:13 pm

Re: Graphics File Not Found

Post by Borough »

I've just tried it again. Still no luck.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10348
Joined: Mon Mar 10, 2008 9:44 pm

Re: Graphics File Not Found

Post by Stefan Kottwitz »

Perhaps post the complete log file, as attachment here, it contains a lot of information and of course errors and warnings. The previous message was just an error message.

Stefan
LaTeX.org admin
Borough
Posts: 6
Joined: Mon Aug 15, 2011 4:13 pm

Re: Graphics File Not Found

Post by Borough »

This is pdfTeX, Version 3.1415926-2.3-1.40.12 (MiKTeX 2.9) (preloaded format=pdflatex 2011.7.30) 15 AUG 2011 18:48
entering extended mode
**Test.tex
(C:\Users\Chiraag\Dissertation\Test.tex
LaTeX2e <2009/09/24>
Babel <v3.8l> 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-2009-06-19, greek, gujarati, hindi, hungarian, iceland
ic, indonesian, interlingua, irish, italian, kannada, kurmanji, lao, latin, lat
vian, lithuanian, malayalam, marathi, mongolian, mongolianlmc, monogreek, ngerm
an, ngerman-x-2009-06-19, nynorsk, oriya, panjabi, pinyin, polish, portuguese,
romanian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedish, swis
sgerman, tamil, telugu, turkish, turkmen, ukenglish, ukrainian, uppersorbian, u
senglishmax, welsh, loaded.
(C:\MiKTEX\tex\latex\base\article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(C:\MiKTEX\tex\latex\base\size10.clo
File: size10.clo 2007/10/19 v1.4h Standard LaTeX file (size option)
)
\c@part=\count79
\c@section=\count80
\c@subsection=\count81
\c@subsubsection=\count82
\c@paragraph=\count83
\c@subparagraph=\count84
\c@figure=\count85
\c@table=\count86
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)
(C:\MiKTEX\tex\latex\amsfonts\amssymb.sty
Package: amssymb 2009/06/22 v3.00
(C:\MiKTEX\tex\latex\amsfonts\amsfonts.sty
Package: amsfonts 2009/06/22 v3.00 Basic AMSFonts support
\@emptytoks=\toks14
\symAMSa=\mathgroup4
\symAMSb=\mathgroup5
LaTeX Font Info: Overwriting math alphabet `\mathfrak' in version `bold'
(Font) U/euf/m/n --> U/euf/b/n on input line 96.
))
(C:\MiKTEX\tex\latex\ams\math\amsmath.sty
Package: amsmath 2000/07/18 v2.13 AMS math features
\@mathmargin=\skip43
For additional information on amsmath, use the `?' option.
(C:\MiKTEX\tex\latex\ams\math\amstext.sty
Package: amstext 2000/06/29 v2.01
(C:\MiKTEX\tex\latex\ams\math\amsgen.sty
File: amsgen.sty 1999/11/30 v2.0
\@emptytoks=\toks15
\ex@=\dimen103
))
(C:\MiKTEX\tex\latex\ams\math\amsbsy.sty
Package: amsbsy 1999/11/29 v1.2d
\pmbraise@=\dimen104
)
(C:\MiKTEX\tex\latex\ams\math\amsopn.sty
Package: amsopn 1999/12/14 v2.01 operator names
)
\inf@bad=\count87
LaTeX Info: Redefining \frac on input line 211.
\uproot@=\count88
\leftroot@=\count89
LaTeX Info: Redefining \overline on input line 307.
\classnum@=\count90
\DOTSCASE@=\count91
LaTeX Info: Redefining \ldots on input line 379.
LaTeX Info: Redefining \dots on input line 382.
LaTeX Info: Redefining \cdots on input line 467.
\Mathstrutbox@=\box26
\strutbox@=\box27
\big@size=\dimen105
LaTeX Font Info: Redeclaring font encoding OML on input line 567.
LaTeX Font Info: Redeclaring font encoding OMS on input line 568.
\macc@depth=\count92
\c@MaxMatrixCols=\count93
\dotsspace@=\muskip10
\c@parentequation=\count94
\dspbrk@lvl=\count95
\tag@help=\toks16
\row@=\count96
\column@=\count97
\maxfields@=\count98
\andhelp@=\toks17
\eqnshift@=\dimen106
\alignsep@=\dimen107
\tagshift@=\dimen108
\tagwidth@=\dimen109
\totwidth@=\dimen110
\lineht@=\dimen111
\@envbody=\toks18
\multlinegap=\skip44
\multlinetaggap=\skip45
\mathdisplay@stack=\toks19
LaTeX Info: Redefining \[ on input line 2666.
LaTeX Info: Redefining \] on input line 2667.
)
(C:\MiKTEX\tex\latex\ams\classes\amsthm.sty
Package: amsthm 2004/08/06 v2.20
\thm@style=\toks20
\thm@bodyfont=\toks21
\thm@headfont=\toks22
\thm@notefont=\toks23
\thm@headpunct=\toks24
\thm@preskip=\skip46
\thm@postskip=\skip47
\thm@headsep=\skip48
\dth@everypar=\toks25
)
(C:\MiKTEX\tex\latex\graphics\graphicx.sty
Package: graphicx 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)
(C:\MiKTEX\tex\latex\graphics\keyval.sty
Package: keyval 1999/03/16 v1.13 key=value parser (DPC)
\KV@toks@=\toks26
)
(C:\MiKTEX\tex\latex\graphics\graphics.sty
Package: graphics 2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)
(C:\MiKTEX\tex\latex\graphics\trig.sty
Package: trig 1999/03/16 v1.09 sin cos tan (DPC)
)
(C:\MiKTEX\tex\latex\00miktex\graphics.cfg
File: graphics.cfg 2007/01/18 v1.5 graphics configuration of teTeX/TeXLive
)
Package graphics Info: Driver file: pdftex.def on input line 91.
(C:\MiKTEX\tex\latex\pdftex-def\pdftex.def
File: pdftex.def 2011/05/27 v0.06d Graphics/color for pdfTeX
(C:\MiKTEX\tex\generic\oberdiek\infwarerr.sty
Package: infwarerr 2010/04/08 v1.3 Providing info/warning/message (HO)
)
(C:\MiKTEX\tex\generic\oberdiek\ltxcmds.sty
Package: ltxcmds 2011/04/18 v1.20 LaTeX kernel commands for general use (HO)
)
\Gread@gobject=\count99
))
\Gin@req@height=\dimen112
\Gin@req@width=\dimen113
)
(C:\Users\Chiraag\Dissertation\Test.aux)
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 7.
LaTeX Font Info: ... okay on input line 7.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 7.
LaTeX Font Info: ... okay on input line 7.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 7.
LaTeX Font Info: ... okay on input line 7.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 7.
LaTeX Font Info: ... okay on input line 7.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 7.
LaTeX Font Info: ... okay on input line 7.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 7.
LaTeX Font Info: ... okay on input line 7.
(C:\MiKTEX\tex\context\base\supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
\scratchcounter=\count100
\scratchdimen=\dimen114
\scratchbox=\box28
\nofMPsegments=\count101
\nofMParguments=\count102
\everyMPshowfont=\toks27
\MPscratchCnt=\count103
\MPscratchDim=\dimen115
\MPnumerator=\count104
\makeMPintoPDFobject=\count105
\everyMPtoPDFconversion=\toks28
)
! LaTeX Error: File `graph1' not found.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.11 \includegraphics{graph1}
I could not locate the file with any of these extensions:
.png,.pdf,.jpg,.mps,.jpeg,.jbig2,.jb2,.PNG,.PDF,.JPG,.JPEG,.JBIG2,.JB2
Try typing <return> to proceed.
If that doesn't work, type X <return> to quit.
[1
{C:/ProgramData/MiKTeX/2.9/pdftex/config/pdftex.map}]
(C:\Users\Chiraag\Dissertation\Test.aux) )
Here is how much of TeX's memory you used:
2027 strings out of 494049
23646 string characters out of 3155731
74680 words of memory out of 3000000
5329 multiletter control sequences out of 15000+200000
3640 words of font info for 14 fonts, out of 3000000 for 9000
715 hyphenation exceptions out of 8191
27i,4n,24p,221b,165s stack positions out of 5000i,500n,10000p,200000b,50000s
<C:/MiKTEX/fonts/type1/public/amsfont
s/cm/cmr10.pfb>
Output written on Test.pdf (1 page, 13299 bytes).
PDF statistics:
10 PDF objects out of 1000 (max. 8388607)
0 named destinations out of 1000 (max. 500000)
1 words of extra memory for PDF output out of 10000 (max. 10000000)
User avatar
Stefan Kottwitz
Site Admin
Posts: 10348
Joined: Mon Mar 10, 2008 9:44 pm

Graphics File Not Found

Post by Stefan Kottwitz »

That's indeed strange. The log file shows you correctly use the compiler. Though the log says
l.11 \includegraphics{graph1}
I could not locate the file with any of these extensions:
.png,.pdf,.jpg,.mps,.jpeg,.jbig2,.jb2,.PNG,.PDF,.JPG,.JPEG,.JBIG2,.JB2
which means that graph1.pdf is not in the same folder as the TeX document, but you said it is so - I would double check but I believe you of cause. I don't see another reason for the error.

Stefan
LaTeX.org admin
Post Reply