lyx_mirror/lib/scripts/fig2pstex.sh
Angus Leeming dd7ae72789 Prepare the way for a shiny new external inset.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7072 a592a061-630c-0410-9148-cb99ea01b6c8
2003-05-31 16:52:33 +00:00

42 lines
1.0 KiB
Bash

#! /bin/sh
# file fig2pstex.sh
# This file is part of LyX, the document processor.
# Licence details can be found in the file COPYING.
#
# author Angus Leeming
#
# Full author contact details are available in file CREDITS
# This script converts an XFIG image to something that latex can process
# into high quality PostScript.
# Usage: sh fig2pstex.sh ${input} ${output}
# to generate the pstex_t file ${output}.
# In turn this file will \includegraphics{${output_base}}.
# The necessary ${output_base}.eps is also generated by this script.
#
# Thereafter, you need only '\input{${output}}' in your latex document.
# We expect two args, the names of the input and output files.
test $# -eq 2 || exit 1
# Can we find fig2dev?
type fig2dev > /dev/null || exit 1
input=$1
output=$2
# Strip the extension from ${output}
outbase=`echo ${output} | sed 's/[.][^.]*$//'`
# Generate the EPS file
outeps=${outbase}.eps
fig2dev -Lpstex ${input} ${outeps}
# Generate the PSTEX_T file
fig2dev -Lpstex_t -p${outbase} ${input} ${output}
# The end