]> git.lyx.org Git - wiki-uploads.git/blob - Tips/UsingLyXWithTgif/tgif-epstool
Import uploads from wiki
[wiki-uploads.git] / Tips / UsingLyXWithTgif / tgif-epstool
1 #!/bin/sh
2 #
3 # Written by Enrico Forestieri on Sun Oct 24 16:10:39 CEST 2004
4 # Added full path to epstool and eliminated the call to tgif-fixepsi
5 # as the new epstool produces correct output - Sun Dec 4 14:58:39 2005
6 #
7 # This script converts the postscript file generated by lyx into eps format
8 # (by ps2eps) and adds a preview bitmap to it (by epstool).
9 # As epstool generates an epsi file with leading and trailing binary codes
10 # which confuse tgif, we also have to remove them. Moreover, tgif displays
11 # the interchange preview bitmap with swapped colors, so we also have to
12 # preventively swap black and white in the preview generated by epstool.
13 #
14 # $2 = dpi
15 # $3 = ps file
16 # $4 = eps file
17
18 CYGWIN_ROOT="c:/cygwin"
19 ps2eps -l -m "$3"
20 mv "$4" "$3"
21 c:/Programmi/Ghostgum/gsview/epstool -i -b --dpi $2 "$CYGWIN_ROOT$3" "$CYGWIN_ROOT$4"
22 ed "$4" 1>/dev/null 2>&1 <<END
23 1 d
24 i
25 %!PS-Adobe-2.0 EPSF-2.0
26 .
27 /%%EOF
28 +,$ d
29 w
30 q
31 END
32 #exec tgif-fixepsi "$CYGWIN_ROOT$4"