TeXnik - Tips TeX and LaTeX


Welcome to the TeXnik website (under construction)

eps Figures
TUG logo

Main page

Index
UK FAQ
Documentation
Software
CTAN
Search CTAN:

Statistics

Google c.t.t.

Google d.c.t.t.

 


 


TeX needs for the postscript output all figures in Postscript (.ps) or Encapsulated Postscript (.eps) format. pdfLatex is different to TeX and needs pdf-format and can convert also jpeg. For more information to pdflatex look at the TeX-FAQ at CTAN.
ps- and eps-figures are a good format for all vector graphics but become enormous file-sizes when using bimapped figures. If your printer understand Postscript Level 2 you can convert these files with
convert myFile.??? eps2:myFile.eps
For more Information to Postscript Level 2 have a look at imgtops2.

Another way is to compress these eps-figures of Postscript Level 1 and decompress them by LaTeX on the run. The only problem is, that LaTeX needs the size of the figure, before unzipping the file. Therefore we need a second file, which has only one line, the size of the Bounding Box:

%%BoundingBox: 0 0 684 676
This is one of the first line in every eps-file. With the following Shell-script every figure can be converted to eps-format with an additional-file (.eps.bb) for the bounding box:

#!/bin/bash
# voss /010506
# convert any file to eps and make a minifile with
# info of the bounding box
# usage:  makeEPS file.???
# program convert is part of ImageMagic
#
dat=$1
OUT=${dat%%.*}      # without suffix
echo "InputFile      =$1"
echo "OutputFile     =$OUT.eps.gz"
echo "BoundingBoxFile=$OUT.eps.bb"
convert $1 $OUT.eps 
grep BoundingBox $OUT.eps > $OUT.eps.bb
ls -l $OUT.eps
gzip $OUT.eps
ls -l $OUT*
Save it in any dir and make it executable. The program convert is part of the ImageMagick package and available in the net. For example:
voss@maria:~/LaTeX> makeEPS myFigure.pcx
InputFile      =myFigure.pcx
OutputFile     =myFigure.eps.gz
BoundingBoxFile=myFigure.eps.bb
-rw-r--r--    1 voss     users      495620 Mai 25 13:26 myFigure.eps
-rw-r--r--    1 voss     users          62 Mai 25 13:25 myFigure.eps.bb
-rw-r--r--    1 voss     users       39346 Mai 25 13:25 myFigure.eps.gz
-r-xr-xr-x    1 voss     users       92459 Jun 23  1994 myFigure.pcx
The compression factor for this example is about 1:10, a good result. The contents of the .bb-file is
%%BoundingBox: 0 0 1304 1472
%%PageBoundingBox: 0 0 1305 1473
TeX needs some information about the file-suffixes and an unzipped tool for the decompressing. The package graphics looks for a file graphic.cfg like the following one, which is in /usr/share/texmf/tex/latex/config, but maybe in any other valid tex-dir:
\@ifundefined{pdfoutput}%
  {\let\pdfoutput\@undefined
    \ExecuteOptions{dvips}%
    \AtEndOfPackage{%
      \@ifundefined{DeclareGraphicsRule}%
        {\let\DeclareGraphicsRule\@undefined}%
        {\DeclareGraphicsRule{.pz}{eps}{.bb}{}%
         \DeclareGraphicsRule{.eps.Z}{eps}{.eps.bb}{}%
         \DeclareGraphicsRule{.ps.Z}{eps}{.ps.bb}{}%
         \DeclareGraphicsRule{.ps.gz}{eps}{.ps.bb}{}%
         \DeclareGraphicsRule{.eps.gz}{eps}{.eps.bb}{}}}%
  }%
  {\ifcase\pdfoutput
      \let\pdfoutput\@undefined
      \ExecuteOptions{dvips}%
      \AtEndOfPackage{%
        \@ifundefined{DeclareGraphicsRule}%
          {\let\DeclareGraphicsRule\@undefined}%
          {\DeclareGraphicsRule{.pz}{eps}{.bb}{}%
           \DeclareGraphicsRule{.eps.Z}{eps}{.eps.bb}{}%
           \DeclareGraphicsRule{.ps.Z}{eps}{.ps.bb}{}%
           \DeclareGraphicsRule{.ps.gz}{eps}{.ps.bb}{}%
           \DeclareGraphicsRule{.eps.gz}{eps}{.eps.bb}{}}}%
   \else
      \ExecuteOptions{pdftex}
   \fi}%
You can modify this file as you like. If you don't have this file, save it in a texdir and run texhash. With this config-file you are able to insert in LaTeX the zipped files.

local time: Sat Aug 24 03:07:48 CEST 2019 ; file is: 58.4230324074074 days old
contact webmaster _at_ TeXnik.de