(Answer) (Category) OSU Physics Faq's : (Category) Computing (general) : (Category) TeX and LaTeX :
Can I include a JPEG (jpg) graphic file directly into TeX or LaTeX?
[Answer Title and Options] [Edit Answer Permissions]
[Duplicate Answer] [Move Answer] [Trash Answer] [Convert to Category]
[Insert Text Here] [Insert Uploaded Text Here]
[Edit This Text] If you want it to be portable, probably not. So you can either convert it to encapsulated postscript (eps) using a graphics program like Gimp, or use a program called jpeg2ps, which puts an eps wrapper on the jpeg file. This means you can treat it like a postscript file (as long as you have at least postscript 2, which is pretty much everywhere these days). So this is essentially like putting it directly in.

The source code (it's in C) for jpeg2ps is available from http://www.pdflib.com/jpeg2ps/.

Here is a Linux executable (right-click on the link and save it to a file called jpeg2ps): </~ntg/download/jpeg2ps> (of version 1.8; check the link above for updates).
Remember to "chmod +x jpeg2ps" to make it executable.

To create file.eps from file.jpg, the command is:

  jpeg2ps -o file.eps file.jpg
or
  jpeg2ps file.jpg > file.eps

2002-Apr-02 8:19am furnstahl.1@osu.edu
[Duplicate This Text]
[Remove This Text]
[Upload New Bag Here]
[Insert Text Here] [Insert Uploaded Text Here]
[Edit This Text] You can find out the options to jpeg2ps by just typing it with no arguments:
  jpeg2ps
and you'll get a list of options. I find the -a (auto rotate) option to be very useful. It automatically switches to landscape mode if the jpeg width is greater than the height. If the picture is too big to fit on a page, it will scale it appropriately.

2002-Apr-02 8:17am furnstahl.1@osu.edu
[Duplicate This Text]
[Remove This Text]
[Upload New Bag Here]
[Insert Text Here] [Insert Uploaded Text Here]
[Append to This Answer]
2002-Apr-02 8:19am
Previous: (Answer) How do I figure out the bounding box (BoundingBox) for an encapsulated postscript file?
Next: (Answer) Is there a way to automatically figure out and insert the bounding box in a postscript file?
This document is: http://www.physics.ohio-state.edu/cgi-bin/fom?file=106
[Search] [Appearance] [Hide Expert Edit Commands]
This is a Faq-O-Matic 2.721.