[texhax] Import JPG pictures into LaTeX

Heiko Oberdiek heiko.oberdiek at googlemail.com
Fri Oct 8 23:19:48 CEST 2010


On Fri, Oct 08, 2010 at 05:04:26PM +0200, Philip G. Ratcliffe wrote:

> > I was using LaTeX in the years of 1988-2003.
> 
> Nothing substantial has changed since then. 

LaTeX2e with NFSS and other features isn't a substantial change?

> > Now I want to use it again. Installed MiKTeX and I am 
> > progressing well. One of my problems now is to include 
> > graphics with colors. I have no problem to use EPS, or 
> > convert from other format into EPS. However I would like to 
> > know if it is possible to use JPG files DIRECTLY without 
> > converting them into EPS format.
> 
> TeX/LaTeX can and have only ever been able to handle EPS format.

No. Image inclusion heavily depends on the output driver (dvips, dvipdfm(x),
PDF mode of pdfTeX, ...). For instance, dvips supports EPS, BMP, PCX, MSP
and can be configured to automatically convert other image file formats.

Usually JPEG files are converted using jpeg2ps to EPS files, jpeg2ps doesn't
change the image data, it only adds a PostScript wrapper to the image data.

> > I took to import a color JPG file, but it shows up as a gray 
> > picture. Conclusion?

Black and white screen, try a monitor with color support. ;-)
Seriously, whithout knowing, what you (OP) are doing, which driver
is used, ..., only guessing and speculation remains, but not real help.

> It seems possible, but I may miss some 
> > usepackage!
> 
> With pdfLaTeX it is possible to use directly other formats.

JPEG, PNG, PDF, JBIG2

Usually EPS files are converted to PDF via "epstopdf" or "ps2pdf -dEPSCrop"
(both rely on or are part of Ghostscript).

> N.B. the peferred way is using \includegraphics[<options>{<filename>}

Addition:
\usepackage{graphicx}
...
\includegraphics[<options>]{<filename>}

Documentation: grfguide

Yours sincerely
  Heiko Oberdiek


More information about the texhax mailing list