Trouble with displaying figures in LaTeX

  • Context: LaTeX 
  • Thread starter Thread starter JoAuSc
  • Start date Start date
  • Tags Tags
    Latex
Click For Summary

Discussion Overview

The discussion revolves around issues related to displaying figures in LaTeX, specifically focusing on file formats and paths used in the document. Participants explore the challenges faced when images do not appear in the output, particularly when generating PDF or PS files.

Discussion Character

  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant reports a blank space where an image should appear, despite no errors in the LaTeX compilation.
  • Another participant questions the correctness of the file path and suggests placing the graphics file in the same directory as the .tex file.
  • Some participants express doubt about the compatibility of .ps files with LaTeX, suggesting that .eps files are preferred.
  • It is mentioned that images in PDF format can also be used, and participants recommend checking the protext package documentation for guidance.
  • A participant notes that the issue may not be with the path, as the figures display correctly when outputting a DVI file, but not when generating PDF or PS files.
  • Another participant highlights the differences in producing PDF files using various methods (pdflatex vs latex+dvipdf vs latex+dvips) and how these methods affect image compatibility.
  • There is a suggestion that pdflatex may not support .eps files directly and that conversion to .pdf or .jpg may be necessary.

Areas of Agreement / Disagreement

Participants generally agree that .ps files are not suitable for use with LaTeX, and there is a consensus on the need to check file paths. However, there is no consensus on the best method for generating PDF files or the specific formats that should be used, indicating multiple competing views remain.

Contextual Notes

Participants mention various LaTeX output methods and their implications for image file compatibility, but do not resolve the specific technical steps needed to address the original issue.

JoAuSc
Messages
197
Reaction score
1
I'm using TeXnic center and I'm trying to figure out how to display figures in LaTex, but all I'm getting is a blank space. (No errors, though. Also, I haven't had problems with ordinary LaTeX stuff.)

Code:
\documentclass{article}

\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[dvips]{graphicx}

\begin{document}

%random text
fgf

\begin{figure}
	\centering
		\includegraphics{D:/chick.ps}
	\label{fig:chick}
\end{figure}

\end{document}
I originally tried this with an .eps file I generated from a MATLAB plot, and got a blank space, so I tried "chick.ps" which is an image file of a yellow chick I found on some help page, but still no result. Does anyone know why my image isn't displaying?
 
Physics news on Phys.org
is the path correct?
Put the graphics file the same directory as the .tex file, then give the filename without the path. (I don't think you can use a .ps file.)
 
I don't think you can use .ps files either. I know that you can use .eps files, though. Like rob said, make sure you put it in the in same folder as you .tex file.
 
You can also use images saved in PDF format. Like the others have said, make sure that you save the file in the same folder as your tex document.

If you're using the protext package that comes with Miktex then there are several pdf latex guides in the protext/doc folder.
 
Last edited:
I don't think the path is the problem here. Thanks for the info on not using .ps. I'll look into the pdf latex guides (yes, I am using a protext package).

I haven't completely solved the problem, but I can say that it works when I output a DVI file, but I get a blank space when I output to PDF (which is what I was doing before) or to PS.
 
IIRC, there is a difference between producing pdf files:
pdflatex vs latex+dvipdf vs latex+dvips+(gs conversion to pdf)
and what kind of images can be used into the graphics statement.
I exclusively use latex+dvips+(gs conversion to pdf).
 
That's true actually; I don't think pdflatex can cope with .eps files in the argument for graphicx. You may have to convert this into a .pdf file, or .jpg (or many other types, I imagine).
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 1 ·
Replies
1
Views
8K
  • · Replies 9 ·
Replies
9
Views
6K
  • · Replies 2 ·
Replies
2
Views
6K
  • · Replies 8 ·
Replies
8
Views
13K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K