From 7590dcfa9851966ee11f880d4e249e799a8ad01f Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrgen=20Vigna?= Date: Mon, 19 Jun 2000 08:27:20 +0000 Subject: [PATCH] Patch from Dekel for fig2pstex git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@819 a592a061-630c-0410-9148-cb99ea01b6c8 --- ChangeLog | 4 ++++ lib/external_templates | 5 +++-- lib/scripts/fig2pstex.py | 23 +++++++++++++++++++++++ 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 lib/scripts/fig2pstex.py diff --git a/ChangeLog b/ChangeLog index 17d994b1b7..23a904fdcb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2000-06-16 Dekel Tsur + + * lib/scripts/fig2pstex.py: New file + 2000-06-16 Juergen Vigna * src/insets/insettabular.C (UpdateLocal): diff --git a/lib/external_templates b/lib/external_templates index 39143ea1dc..f05ddfeeae 100644 --- a/lib/external_templates +++ b/lib/external_templates @@ -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\")" diff --git a/lib/scripts/fig2pstex.py b/lib/scripts/fig2pstex.py new file mode 100644 index 0000000000..68a113d747 --- /dev/null +++ b/lib/scripts/fig2pstex.py @@ -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() -- 2.39.2