Graphics, Figures & TablesInserted JPEG File not displayed in Output

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Rahul
Posts: 29
Joined: Wed Jul 24, 2013 10:07 am

Inserted JPEG File not displayed in Output

Post by Rahul »

Hi,

I'm using a simple code.

Code: Select all

\documentclass[12pt,journal,compsoc]{IEEEtran}
\usepackage{alltt}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{mathtools}
\usepackage{array}
\usepackage{amsmath}

\begin{document}

\begin{figure}[ht]
  \centering
  \includegraphics[width=\linewidth]{image1}
  \caption{my comments}
  \label{referenceForText}
\end{figure}
\end{document}
There are some questions I have :
  1. Should the image lie in the folder we are having the source file?
  2. And when I am using I am getting this error.

    Code: Select all

    Overfull \hbox (19.95824pt too wide) in paragraph at lines 96--123
     [][] 
    
    Overfull \hbox (18.2944pt too wide) in paragraph at lines 129--150
     [][] 
    
    Underfull \hbox (badness 10000) in paragraph at lines 153--157
    
    [3]
    Overfull \hbox (181.7277pt too wide) detected at line 223
    \OML/cmm/m/it/12 R[] \OT1/cmr/m/n/12 = [] []
    ! Undefined control sequence.
    l.229   \includegraphics
                            
    ? 
    
Is the image too large? The source file divides the text in two columns.
Last edited by cgnieder on Wed Jul 24, 2013 5:38 pm, edited 1 time in total.

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

Inserted JPEG File not displayed in Output

Post by Johannes_B »

The example you gave does not have over 100 lines of code, so i can't tell if pictures are too large. Have a look at those lines in your input file to check it out yourself. A wild guess tells me, that those might be equations.

To include graphics into your document, you need to load graphicx. The jpeg-files need to be in the same folder as your main tex-document. You can put them in a subfolder tough, but you have to tell LaTeX about it:

Code: Select all

\includegraphics{NameOfTheSubfolder/NameOfFileWithoutEnding}
I strongly advise you to read some introductory material. You can also check out the featured book at the right side of this page.


Please read the captions in the following example to learn something about the linewidth in twocolumn documents.

Code: Select all

\documentclass[12pt,journal,compsoc]{IEEEtran}
\usepackage{graphicx}
\usepackage{blindtext}

\begin{document}
\blindtext[3]

\begin{figure}
  \centering
  \includegraphics[width=\linewidth]{example-image-a}
  \caption{linewidth in a two column document refers 
  to the width of one column}
  \label{referenceForpicA}
\end{figure}

\begin{figure*}
  \centering
  \includegraphics[width=\linewidth]{example-image-b}
  \caption{The starred version puts your pic over both 
  columns, linewidth now refers to the width of both 
  columns and the little space between them.}
  \label{referenceForpicB}
\end{figure*}

\blindtext[3]
\end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply