## LaTeX forum ⇒ Graphics, Figures & Tables ⇒ Latex images are not showing!

Information and discussion about graphics, figures & tables in LaTeX documents.
yurica
Posts: 7
Joined: Thu Mar 23, 2017 9:54 pm

### Latex images are not showing!

Hi Latex Community!

I am facing some issues trying to insert images on my code. The problem is: none of them are being displayed. However, I am not getting any errors and the file compiles normally. Here is the library packages I am using followed by an image insertion code example (I am using this same code for all my images):

Note 1: Ignore the portuguese comments in my code, I am from Brazil
Note 2: The packages with "%" are packages that I've already tried to use to insert the images, and none of them worked.


\begin{figure}[!htb]	\centering %centralizar a figura	\includegraphics[height=5cm]{Figuras/Imagem001.eps}\end{figure}

Thanks in advance! Any help would be appreciated. I am completely new in the latex language and syntax.

Tags:

Stefan Kottwitz
Posts: 8704
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:
Hi yurica,

welcome to the forum!

Your code has to run LaTeX in DVI mode. Perhaps the editor or something causes it to run in pdfLaTeX mode. Could you please post your .log file, as attachment?
EPS files are only supported by LaTeX in DVI mode that produces DVI, and PDF is created for example using dvi2ps and ps2pdf. pdfLaTeX goes the direct way but doesn't support EPS, but with epstopdf in addition.

Stefan

yurica
Posts: 7
Joined: Thu Mar 23, 2017 9:54 pm
Helo Stefan,

Thanks for the quick reply, and sorry for my late answer. I figured it out that my LaTeX was running in pdfLaTeX mode. So I converted my first image (Imagem001.pdf) to a pdf file and now I get an error while trying to compile it:

"Cannot determine size of graphic in Figuras/Imagem001.pdf (no BoundingBox). ...aphics[height=5cm]{Figuras/Imagem001.pdf}"

I am using this code to insert it:

\begin{figure}[!htb]	\centering %centralizar a figura	\includegraphics[height=5cm]{Figuras/Imagem001.eps}\end{figure}

Also, how do I "copy" my log to post it here as an attachment? Sorry, I am really a beginner using this software. Thanks again for the answer!

Stefan Kottwitz
Posts: 8704
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:
Hi yurica!

In your code, there is ".eps", not ".pdf".

Besides that, the "Cannot determine size of graphic" still looks like LaTeX is running in DVI mode, trying to get bounding box information from an eps but that doesn't work worth pdf. Ensure that it's really pdf.

You can attach a .log file here, this way: below the edit field for writing a post, when writing, there's a tab options and a tab "Attachments", click this. Then click the "Add files" button.

Stefan

yurica
Posts: 7
Joined: Thu Mar 23, 2017 9:54 pm
Hi Stefan!

Thank you! I got every image showing up perfectly now in the .eps format and DVI mode! But now that they showed up, I got another problem. They are not in the position that I want them to be. How do I insert them exactly at the place where the code is? Also, using .eps format, how do I move the image to the right/left and also change its size? Thank you again for your patience and time.

Yuri.

Stefan Kottwitz
Posts: 8704
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:
LaTeX figures are designed to move to an optimal place for best page breaks, filling the page. If you place them exactly in the code, you can get page break issues since the code place may not be the best fit for page breaks - often one can then get white space at page bottoms. The figure philosophy, also in good books, is placing figure near, such as at the top of the next page, floating text before, filling the page. And that's why book's figures have numbers for referencing: they appear a bit later in the text, for page design.

So, I would use \begin{figure}[!htbp] to allow floating but to the next possible place here, top, bottom or page.

If you insist on here, definitely, even if there's no space, you can use \begin{figure}[H] but before load the float package: \usepackage{float}.

Stefan

yurica
Posts: 7
Joined: Thu Mar 23, 2017 9:54 pm
Hi Stefan!

Thank you for the help. I have one last (maybe) question. When compiling and previewing my DVI file using the standard "Yet Another Previewer (YAP)", I can see that everything is okay. However, if I update anything in my code (text, images...) and compile it again, I keep seeing the "old" preview file, without the new changes. Do you know how to fix this? Thank you in advance.

Ps.: I am writing a SciLab programming book for one of my professors in the university. I work with him only on Thursdays and Fridays, and that's why I take some time to answer/ask.

Yuri

Stefan Kottwitz
Posts: 8704
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:
Hi Yuri,

is the file actually changed? So, is it updated if you close the previewer and open it again? I just think about the possibility that an error in the code may prevent creating a new output file.

As far as I know, YAP is for previewing DVI, not PDF. That may also be a reason. SumatraPDF is a very good and fast PDF reader on windows, syncing with TeX.

Stefan

yurica
Posts: 7
Joined: Thu Mar 23, 2017 9:54 pm
Hi Stefan,

I am constantly changing the file and even if I close YAP and open it again, it shows me an old version of it. Many people have the same problem with YAP, and I never find a solution. I was wondering if you knew a fix for this issue. I am working with DVI format for now on, as well as EPS images, not a PDF file. Anyway, thanks for the tips and I'll try to find a new DVI previewer. See ya!

Yuri