Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I don't have access to my image files so I want to only compile with the text. I figured using draft mode would solve this problem but I still get a "cannot find image file" error.

How can I compile without having to copy some random picture I do have.

Here is my header

\newcommand{\rootFolder}{/home/pa06r/pa06r-thesis}

\documentclass{\rootFolder/latex_templates/tex/latex/ecsdocs/ecsthesis}      

\graphicspath{{\rootFolder/images/}}  % Location of your graphics files

\usepackage[demo]{graphicx}     %Use for graphics

\usepackage{subfigure}      %Use for side-by-side figures

\usepackage{float}      % Use for floating figuress

\usepackage[round]{natbib}      % Use Natbib style for the refs.

\usepackage{multirow}       %Use for multirow tables

\usepackage{rotating}       %Use for rotating tables

\usepackage{colortbl}       %Use for coloring table backgrounds

\usepackage{algorithmic}    %Use for algorithms

\usepackage{algorithm}      %Use for algorithm labels

\usepackage{ulem}       %Use for strikethroughs

\usepackage{listings}       %Use for Pseudocode

\usepackage{color}      %package listings needs this

\usepackage{textcomp}       %Used for tilde character

\hypersetup{colorlinks=true}    %Set to false for black/white printing

\usepackage{lscape}     %For rotating pages with long images

Minimal example as per Joseph Wrights request. I created a .texfile with the following

\RequirePackage[demo]{graphicx}
\documentclass{article}
\begin{document}
\includegraphics{'img.jpg'}
\end{document}

Here is the log file

This is pdfeTeX, Version 3.141592-1.21a-2.2 (Web2C 7.5.4) (format=pdflatex 2010.5.13)  5 OCT 2011 22:08
entering extended mode
**test.tex
(./test.tex
LaTeX2e <2003/12/01>
Babel <v3.8d> and hyphenation patterns for american, french, german, ngerman, b
ahasa, basque, bulgarian, catalan, croatian, czech, danish, dutch, esperanto, e
stonian, finnish, greek, icelandic, irish, italian, latin, magyar, norsk, polis
h, portuges, romanian, russian, serbian, slovak, slovene, spanish, swedish, tur
kish, ukrainian, nohyphenation, loaded.
(/usr/share/texmf/tex/latex/graphics/graphicx.sty
Package: graphicx 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)

(/usr/share/texmf/tex/latex/graphics/keyval.sty
Package: keyval 1999/03/16 v1.13 key=value parser (DPC)
\KV@toks@=\toks14
)
(/usr/share/texmf/tex/latex/graphics/graphics.sty
Package: graphics 2001/07/07 v1.0n Standard LaTeX Graphics (DPC,SPQR)

(/usr/share/texmf/tex/latex/graphics/trig.sty
Package: trig 1999/03/16 v1.09 sin cos tan (DPC)
)
(/usr/share/texmf/tex/latex/graphics/graphics.cfg
File: graphics.cfg 2005/02/03 v1.3 graphics configuration of teTeX/TeXLive
)

! LaTeX Error: Unknown option `demo' for package `graphics'.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.72 \if
        !\Gin@driver!
? 
Package graphics Info: Driver file: pdftex.def on input line 80.
(/usr/share/texmf/tex/latex/graphics/pdftex.def
File: pdftex.def 2002/06/19 v0.03k graphics/color for pdftex
\Gread@gobject=\count79
))
\Gin@req@height=\dimen102
\Gin@req@width=\dimen103
)
(/usr/share/texmf/tex/latex/base/article.cls
Document Class: article 2004/02/16 v1.4f Standard LaTeX document class
(/usr/share/texmf/tex/latex/base/size10.clo
File: size10.clo 2004/02/16 v1.4f Standard LaTeX file (size option)
)
\c@part=\count80
\c@section=\count81
\c@subsection=\count82
\c@subsubsection=\count83
\c@paragraph=\count84
\c@subparagraph=\count85
\c@figure=\count86
\c@table=\count87
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen104
)
No file test.aux.
\openout1 = `test.aux'.

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 3.
LaTeX Font Info:    ... okay on input line 3.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 3.
LaTeX Font Info:    ... okay on input line 3.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 3.
LaTeX Font Info:    ... okay on input line 3.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 3.
LaTeX Font Info:    ... okay on input line 3.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 3.
LaTeX Font Info:    ... okay on input line 3.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 3.
LaTeX Font Info:    ... okay on input line 3.
(/usr/share/texmf/tex/context/base/supp-pdf.tex
(/usr/share/texmf/tex/context/base/supp-mis.tex
loading : Context Support Macros / Miscellaneous (2004.10.26)
\protectiondepth=\count88
\scratchcounter=\count89
\scratchtoks=\toks15
\scratchdimen=\dimen105
\scratchskip=\skip43
\scratchmuskip=\muskip10
\scratchbox=\box26
\scratchread=\read1
\scratchwrite=\write3
\zeropoint=\dimen106
\onepoint=\dimen107
\onebasepoint=\dimen108
\minusone=\count90
\thousandpoint=\dimen109
\onerealpoint=\dimen110
\emptytoks=\toks16
\nextbox=\box27
\nextdepth=\dimen111
\everyline=\toks17
\!!counta=\count91
\!!countb=\count92
\recursecounter=\count93
)
loading : Context Support Macros / PDF (2004.03.26)
\nofMPsegments=\count94
\nofMParguments=\count95
\MPscratchCnt=\count96
\MPscratchDim=\dimen112
\MPnumerator=\count97
\everyMPtoPDFconversion=\toks18
)

LaTeX Warning: File `'img.jpg'' not found on input line 4.


! LaTeX Error: Unknown graphics extension: .jpg'.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.4 \includegraphics{'img.jpg'}

? 
(./test.aux) ) 
Here is how much of TeX's memory you used:
 868 strings out of 94500
 10335 string characters out of 1176766
 56775 words of memory out of 1000000
 4098 multiletter control sequences out of 10000+50000
 3640 words of font info for 14 fonts, out of 500000 for 2000
 580 hyphenation exceptions out of 1000
 25i,1n,19p,220b,36s stack positions out of 1500i,500n,5000p,200000b,5000s
PDF statistics:
 0 PDF objects out of 300000
 0 named destinations out of 131072
 1 words of extra memory for PDF output out of 65536

No pages of output.
share|improve this question
    
I tried all variations of demo and draft for both graphicxand documentclassand I even tried compiling with pdflatex -draftmode but I still get cannot find image file...fatal error occoured. –  puk Oct 5 '11 at 19:00
1  
Perhaps try deleting the .aux file and use @JosephWright's answer again. –  Werner Oct 5 '11 at 19:05
    
@Werner I deleted all .aux files and it still didn't work –  puk Oct 5 '11 at 20:50
4  
@puk From your updated question, I see that you have a very old installation (your graphics is 6 years old). The demo option was added many years ago to help with cases like yours. You could install graphics 'locally', but as it is such a core part of LaTeX I'd suggest your better updating your TeX system. –  Joseph Wright Oct 5 '11 at 21:20
1  
@puk: Further to Joseph's comment, note the date of your file graphics.sty: 2001/07/07. Even in TeX Live 2009 (via ScribTeX), this file has a date of 2009/02/05. –  Werner Oct 5 '11 at 21:23
show 4 more comments

1 Answer

The demo option for the graphicx package is your friend

\usepackage[demo]{graphicx}

will insert a square black 'blob' in place of the real images, and will not search for them. (The draft option does not include images, but does find out how big they are, which still requires the files.)

The demo option ignores the files entirely. Thus all of the 'blobs' are the same size, unless there was an explicit height or width given as an argument to \includegraphics.


A short demo of how to do this before loading a class (which might then load graphic(s|x)):

\RequirePackage[demo]{graphicx}
\documentclass{article}
\begin{document}
\includegraphics{whatever}
\end{document}
share|improve this answer
    
It is still not working. I am using pdflatex, would that make a difference? –  puk Oct 5 '11 at 19:04
    
@puk As you are using a non-standard class, you may need to \RequirePackage[demo]{graphicx} before the \documentclass line. This will sort out any issue if the document class requires the package. –  Joseph Wright Oct 5 '11 at 19:06
    
I am encountering a host of problems. it says unknown option demo for graphicx. Do I still need to include the usepackage[demo]{graphicx} line? –  puk Oct 5 '11 at 20:55
    
sorry, it says unknown option demo for graphics (not graphicx) –  puk Oct 5 '11 at 20:57
    
@puk Please try the minimal demo I've added to my answer. if that fails, we'll need to see a log file: Run my example and add the log to your question. –  Joseph Wright Oct 5 '11 at 21:03
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.