[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Groff] EPS from PIC?
From: |
Werner LEMBERG |
Subject: |
Re: [Groff] EPS from PIC? |
Date: |
Thu, 30 Oct 2003 15:34:18 +0100 (CET) |
> I'm using gpic(1) within LaTeX for figures; unfortunately the
> generated TeX code relies on DVI drivers to implement certain
> \specials. Those are not supported by all drivers and in particular
> not by pdflatex(1). As an alternative I'm looking for a way to
> generate an EPS file from a PIC diagram. It seems that groff can
> generate PS, but not EPS. I'm aware of ps2eps(1) and the like but
> would like to hear your suggestion.
I suggest the script below to convert a PIC image for LaTeX to an EPS
file which can be directly included into any PDF document.
Werner
======================================================================
#! /bin/sh
#
# piclatex2eps
#
# convert a PIC image wrapped into a LaTeX document to an EPS file
#
# usage:
#
# piclatex2eps <namestem>
#
# the input file must be called <namestem>.pic; the output file is
# called <namestem>.eps
#
# used tools: GNU pic, latex, dvips, gs, sed, cat, rm
pic -t $1.pic > $1.tex
latex $1.tex
dvips -E -o $1.ps $1.dvi
# get the correct bounding box; dvips is fooled by \special commands
gs -dNOPAUSE -sDEVICE=bbox -- $1.ps 2> $1.bbox
cat $1.ps \
| sed -e "
/%%BoundingBox/ {
r $1.bbox
d
}
" > $1.eps
rm $1.tex $1.aux $1.log $1.dvi $1.ps $1.bbox
# EOF