Patch from Dekel for fig2pstex

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@819 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Vigna 2000-06-19 08:27:20 +00:00
parent 60a085fb1c
commit 7590dcfa98
3 changed files with 30 additions and 2 deletions

View File

@ -1,3 +1,7 @@
2000-06-16 Dekel Tsur <dekel@math.tau.ac.il>
* lib/scripts/fig2pstex.py: New file
2000-06-16 Juergen Vigna <jug@sad.it>
* src/insets/insettabular.C (UpdateLocal):

View File

@ -63,8 +63,9 @@ Template XFig
EditCommand "xfig $$FName"
AutomaticProduction true
Format LaTeX
Product "$$Contents(\"$$Basename.tex\")"
UpdateCommand "fig2dev $$Parameters -L latex $$FName $$Basename.tex"
Product "\\begin{picture}(0,0)\\includegraphics{$$Basename.eps}\\end{picture}\\input{$$Basename.pstex_t}"
UpdateCommand "python $$Sysdir/scripts/fig2pstex.py $$FName $$Parameters"
Requirement "graphics"
FormatEnd
Format Ascii
Product "$$Contents(\"$$Basename.asc\")"

23
lib/scripts/fig2pstex.py Normal file
View File

@ -0,0 +1,23 @@
#!/usr/bin/python
# This script converts a xfig file into Postscript/LaTeX files
import sys
import os
filename = sys.argv[1]
basename = os.path.splitext(filename)[0]
parameters = sys.argv[2:]
pid = os.fork()
if pid == 0:
os.execvp("fig2dev", ["fig2dev", "-Lpstex"] + parameters + [filename, basename + ".eps"])
print "fig2dev did not work"
os.exit(1)
os.wait()
pid = os.fork()
if pid == 0:
os.execvp("fig2dev", ["fig2dev", "-Lpstex_t"] + parameters + [filename, basename + ".pstex_t"])
print "convert did not work second time"
os.exit(1)
os.wait()