Graphics, Figures & TablesImage errors

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Arland
Posts: 2
Joined: Tue Sep 09, 2014 3:20 pm

Image errors

Post by Arland »

Here's the code:

Code: Select all

\begin{figure}
\centering
\includegraphics[width=0.7\linewidth]{C:/xxxxx/te124_f3}
\caption{}
\label{fig:te124_f3}
\end{figure}
this was generated both by using the wizard and dragging the file into TeXstudio. When I try to compile this I get this error:

Code: Select all

"Undefined control sequence 
    \includegraphics
I imagine the rest of the errors come from this as well. Any idea of how to fix this?

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

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Image errors

Post by Johannes_B »

A wild guess: Did you load package graphicx? You need this.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Arland
Posts: 2
Joined: Tue Sep 09, 2014 3:20 pm

Re: Image errors

Post by Arland »

Got it. Thanks
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Image errors

Post by Stefan Kottwitz »

Hi Arland,

welcome to the forum!

That's mainly what I wanted to say at this occasion :) but why not a small addition: if you like to have the image pretty near to where it's placed in the code, you could achieve that by relaxing the default placement options for it:

Code: Select all

\begin{figure}[!htbp]
Just to let you know. It allows placement here, top, bottom, or on its own page, with less restrictions. Educational papers often show images very near to where they are referenced, while bigger books tend to put them "here" or at the top of a page, avoiding too much images on a page (default LaTeX behavior).

Stefan
LaTeX.org admin
wilburbntn4
Posts: 1
Joined: Mon Sep 29, 2014 3:43 pm

Image errors

Post by wilburbntn4 »

Stefan_K wrote:Hi Arland,

welcome to the forum!

That's mainly what I wanted to say at this occasion :) but why not a small addition: if you like to have the image pretty near to where it's placed in the code, you could achieve that by relaxing the default placement options for it:

Code: Select all

\begin{figure}[!htbp]
Just to let you know. It allows placement here, top, bottom, or on its own page, with less restrictions. Educational papers often show images very near to where they are referenced, while bigger books tend to put them "here" or at the top of a page, avoiding too much images on a page (default LaTeX behavior).

Stefan
Thanks for sharing this. Very helpful. If it is okay, can you put up a link to where I can read up more on handling images? Thanks
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Image errors

Post by Johannes_B »

A very extensive description on how to influence the positioning can be found on TeX.SX, written by one of the authors of the LaTeX companion.

What else would you like to know?
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
noo
Posts: 2
Joined: Fri Nov 07, 2014 11:05 pm

Re: Image errors

Post by noo »

I am new in Scientific Word, I appreciate if you help.
I have prepared the my file and imported my figures. Now i have to upload my .tex file to a website but only one file is allowed (not pdf) . How should i embed my .wmf files which are for my pictures to .tex file, that when they make pdf file, it recognize the pictures. ?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Re: Image errors

Post by Stefan Kottwitz »

Hi noo,

welcome to the forum!

I noticed, you posted your question twice, each time attaching to an old thread. There our users hardly can see your new question, even regarding a topic which is different to the one solved in the original thread.

Just open a new topic for each question you have.

Stefan
LaTeX.org admin
Post Reply