Graphics, Figures & TablesGraphic Import fails

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Disappearance
Posts: 1
Joined: Wed Oct 23, 2013 10:15 pm

Graphic Import fails

Post by Disappearance »

Here is my preamble:

Code: Select all

\documentclass[a4paper,12pt]{article}
\usepackage[protrusion=true,expansion=true]{microtype} 
\usepackage{graphicx}
\usepackage{wrapfig} 
\usepackage{mathpazo} 
\usepackage[T1]{fontenc} 
\linespread{1.05}

\usepackage[pdftex]{graphicx}
\graphicspath{{C:\Users\Mark\Documents\Coursework\Subject of Sex 2}}
 \DeclareGraphicsExtensions{.pdf,.jpeg,.png,.jpg}

\makeatletter
\renewcommand\@biblabel[1]{\textbf{#1.}} bibliography item from '[1]' to '1.'
\renewcommand{\@listI}{\itemsep=0pt} 

\renewcommand{\maketitle}{
\begin{flushright} 
{\LARGE\@title} 

\vspace{50pt} 

{\large\@author} 
\\\@date % Date

\vspace{40pt} 
\end{flushright}
}
I have a short Introduction section, and at the end of this, I want to include a graphic which is in .jpg format. What follows is the line I use place the graphic:

Code: Select all

\begin{figure}[h!]
 \centering
  \includegraphics[width=0.5\textwidth]{dream}
 \caption{Japanese Erotica}
 \end{figure}
I use TexMaker and Quick Build to finish the document but I get the process exited with error message with the following:

Code: Select all

! LaTeX Error: Option clash for package graphicx.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.11 \graphicspath
{{C:\Users\Mark\Documents\Coursework\Subject of Sex 2}}
The package graphicx has already been loaded with options:
[]
There has now been an attempt to load it with options
[pdftex]
Adding the global options:
,pdftex
to your \documentclass declaration may fix this.
Try typing <return> to proceed.
("C:\Users\Mark\Documents\Coursework\Subject of Sex 2\SS2 Course Essay.aux")
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 47.
LaTeX Font Info: ... okay on input line 47.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 47.
LaTeX Font Info: ... okay on input line 47.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 47.
LaTeX Font Info: ... okay on input line 47.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 47.
LaTeX Font Info: ... okay on input line 47.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 47.
LaTeX Font Info: ... okay on input line 47.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 47.
LaTeX Font Info: ... okay on input line 47.
LaTeX Font Info: Try loading font information for T1+ppl on input line 47.
("C:\Program Files\MiKTeX Basic\tex\latex\psnfss\t1ppl.fd"
File: t1ppl.fd 2001/06/04 font definitions for T1/ppl.
)
LaTeX Info: Redefining \microtypecontext on input line 47.
Package microtype Info: Generating PDF output.
Package microtype Info: Character protrusion enabled (level 2).
Package microtype Info: Using default protrusion set `alltext'.
Package microtype Info: Automatic font expansion enabled (level 2),
(microtype) stretch: 20, shrink: 20, step: 1, non-selected.
Package microtype Info: Using default expansion set `basictext'.
Package microtype Info: No adjustment of tracking.
Package microtype Info: No adjustment of interword spacing.
Package microtype Info: No adjustment of character kerning.
("C:\Program Files\MiKTeX Basic\tex\latex\microtype\mt-ppl.cfg"
File: mt-ppl.cfg 2005/11/16 v1.6 microtype config. file: Palatino (RS)
)
("C:\Program Files\MiKTeX Basic\tex\context\base\supp-pdf.mkii"
[Loading MPS to PDF converter (version 2006.09.02).]
\scratchcounter=\count91
\scratchdimen=\dimen108
\scratchbox=\box27
\nofMPsegments=\count92
\nofMParguments=\count93
\everyMPshowfont=\toks17
\MPscratchCnt=\count94
\MPscratchDim=\dimen109
\MPnumerator=\count95
\makeMPintoPDFobject=\count96
\everyMPtoPDFconversion=\toks18
)
\big@size=\dimen110
LaTeX Font Info: Font shape `T1/ppl/bx/n' in size <20.74> not available
(Font) Font shape `T1/ppl/b/n' tried instead on input line 49.
LaTeX Font Info: Font shape `T1/ppl/bx/n' in size <17.28> not available
(Font) Font shape `T1/ppl/b/n' tried instead on input line 65.
! Undefined control sequence.
\reserved@b ->C:\Users
\Mark \Documents \Coursework \Subject of Sex 2
l.71 ...degraphics[width=0.5\textwidth]{dream lol}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\reserved@b ->C:\Users \Mark
\Documents \Coursework \Subject of Sex 2
l.71 ...degraphics[width=0.5\textwidth]{dream lol}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\reserved@b ->C:\Users \Mark \Documents
\Coursework \Subject of Sex 2
l.71 ...degraphics[width=0.5\textwidth]{dream lol}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\reserved@b ...Users \Mark \Documents \Coursework
\Subject of Sex 2
l.71 ...degraphics[width=0.5\textwidth]{dream lol}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\reserved@b ...rk \Documents \Coursework \Subject
of Sex 2
l.71 ...degraphics[width=0.5\textwidth]{dream lol}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\reserved@b ->C:\Users
\Mark \Documents \Coursework \Subject of Sex 2
l.71 ...degraphics[width=0.5\textwidth]{dream lol}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\reserved@b ->C:\Users \Mark
\Documents \Coursework \Subject of Sex 2
l.71 ...degraphics[width=0.5\textwidth]{dream lol}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\reserved@b ->C:\Users \Mark \Documents
\Coursework \Subject of Sex 2
l.71 ...degraphics[width=0.5\textwidth]{dream lol}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\reserved@b ...Users \Mark \Documents \Coursework
\Subject of Sex 2
l.71 ...degraphics[width=0.5\textwidth]{dream lol}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\reserved@b ...rk \Documents \Coursework \Subject
of Sex 2
l.71 ...degraphics[width=0.5\textwidth]{dream lol}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\reserved@b ->C:\Users
\Mark \Documents \Coursework \Subject of Sex 2
l.71 ...degraphics[width=0.5\textwidth]{dream lol}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\reserved@b ->C:\Users \Mark
\Documents \Coursework \Subject of Sex 2
l.71 ...degraphics[width=0.5\textwidth]{dream lol}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\reserved@b ->C:\Users \Mark \Documents
\Coursework \Subject of Sex 2
l.71 ...degraphics[width=0.5\textwidth]{dream lol}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\reserved@b ...Users \Mark \Documents \Coursework
\Subject of Sex 2
l.71 ...degraphics[width=0.5\textwidth]{dream lol}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\reserved@b ...rk \Documents \Coursework \Subject
of Sex 2
l.71 ...degraphics[width=0.5\textwidth]{dream lol}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\reserved@b ->C:\Users
\Mark \Documents \Coursework \Subject of Sex 2
l.71 ...degraphics[width=0.5\textwidth]{dream lol}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\reserved@b ->C:\Users \Mark
\Documents \Coursework \Subject of Sex 2
l.71 ...degraphics[width=0.5\textwidth]{dream lol}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\reserved@b ->C:\Users \Mark \Documents
\Coursework \Subject of Sex 2
l.71 ...degraphics[width=0.5\textwidth]{dream lol}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\reserved@b ...Users \Mark \Documents \Coursework
\Subject of Sex 2
l.71 ...degraphics[width=0.5\textwidth]{dream lol}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\reserved@b ...rk \Documents \Coursework \Subject
of Sex 2
l.71 ...degraphics[width=0.5\textwidth]{dream lol}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! LaTeX Error: File `dream lol' not found.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.71 ...degraphics[width=0.5\textwidth]{dream lol}
I could not locate the file with any of these extensions:
.pdf,.jpeg,.png,.jpg
Try typing <return> to proceed.
If that doesn't work, type X <return> to quit.
LaTeX Warning: `!h' float specifier changed to `!ht'.
[1
{C:/ProgramData/MiKTeX/2.9/pdftex/config/pdftex.map}] [2]
No file SS2*Course*Essay.bbl.
[3] ("C:\Users\Mark\Documents\Coursework\Subject of Sex 2\SS2 Course Essay.aux"
) )
Here is how much of TeX's memory you used:
2952 strings out of 493921
44684 string characters out of 3146483
123739 words of memory out of 3000000
6193 multiletter control sequences out of 15000+200000
18322 words of font info for 68 fonts, out of 3000000 for 9000
841 hyphenation exceptions out of 8191
30i,4n,35p,1292b,168s stack positions out of 5000i,500n,10000p,200000b,50000s
{C:/Program Files/MiKTeX Basic/fonts/enc/dvips/fontname/8r.enc}<C:/Program F
iles/MiKTeX Basic/fonts/type1/urw/palatino/uplb8a.pfb><C:/Program Files/MiKTeX
Basic/fonts/type1/urw/palatino/uplr8a.pfb><C:/Program Files/MiKTeX Basic/fonts/
type1/urw/palatino/uplri8a.pfb>
Output written on "SS2 Course Essay.pdf" (3 pages, 51177 bytes).
PDF statistics:
25 PDF objects out of 1000 (max. 8388607)
0 named destinations out of 1000 (max. 500000)
14337 words of extra memory for PDF output out of 14400 (max. 10000000)
I'd like someone to tell me what is going wrong with the code.
Thanks,

M.

Recommended reading 2024:

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

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Graphic Import fails

Post by localghost »

Disappearance wrote:[…] I'd like someone to tell me what is going wrong with the code. […]
Ask yourself the question why you load graphicx twice. And drop this unnecessary pdftex driver option. The package itself does best in choosing the correct driver.


Remarks:
  • Move microtype after all font related packages (fontenc and mathpazo here).
  • There are smarter ways for modifying the document title, e.g. by the titling package.
  • We prefer a self-contained and minimal example that demonstrates the problem instead of code fragments.

Best regards and welcome to the board
Thorsten
Post Reply