[fptex] including jpg

LUK ShunTim ShunTim.Luk@polyu.edu.hk
Tue, 15 Jan 2002 16:21:43 +0800


Manuel López Mariscal wrote:

> Hi every one:
> 
> Is there a package to include jpg files directly in latex documents 
> without having to convert them to postcript or eps? If there is, is the 
> package implemented in fptex? Thanks very much,
> 
>  


The following worked for me. Replace "test.jpg" with the name of your .jpg file.

<quote>

\documentclass{article}
\usepackage[dvips]{graphicx}
\begin{document}
This includes a JPEG file.
\DeclareGraphicsRule{.jpg}{eps}{.bb}{`convert #1 eps:-}
\begin{figure}
\begin{center}
\includegraphics{test.jpg}
\caption{JPEG graphic converted by ImageMagick}
\end{center}
\end{figure}
\end{document}
</quote>

But this is a cheat :-).

It *used* the "convert" programme from imagemagick, but just did it on the fly. 
and it apparently requires an OS which supports pipes. It worked on my W2K box 
but W95/98 may not work. You also have to create the file "test.bb" which 
contains the bounding box information; ie, you have to know the size of your 
jpeg image.

So I don't know whether a direct conversion is better.


I don't understand very much how dvips or other drivers work so I post what I 
know here hoping that others can enlighten me more.

Good day,
ST
--


> 
> Manuel López
>