]> git.lyx.org Git - lyx.git/blob - lib/scripts/fig2pstex.sh
*lib/scripts/layout2layout.py: Fix section labelling
[lyx.git] / lib / scripts / fig2pstex.sh
1 #! /bin/sh
2
3 # file fig2pstex.sh
4 # This file is part of LyX, the document processor.
5 # Licence details can be found in the file COPYING.
6 #
7 # author Angus Leeming
8 #
9 # Full author contact details are available in file CREDITS
10
11
12 # This script converts an XFIG image to something that latex can process
13 # into high quality PostScript.
14
15 # Usage: sh fig2pstex.sh ${input} ${output}
16 # to generate the pstex_t file ${output}.
17 # In turn this file will \includegraphics{${output_base}}.
18 # The necessary ${output_base}.eps is also generated by this script.
19 #
20 # Thereafter, you need only '\input{${output}}' in your latex document.
21
22 # We expect two args, the names of the input and output files.
23 test $# -eq 2 || exit 1
24
25 # Can we find fig2dev?
26 type fig2dev > /dev/null || exit 1
27
28 input=$1
29 output=$2
30
31 # Fail silently if the file doesn't exist
32 test -r $input || exit 0
33
34 # Strip the extension from ${output}
35 outbase=`echo ${output} | sed 's/[.][^.]*$//'`
36
37 # Generate the EPS file
38 outeps=${outbase}.eps
39 fig2dev -Lpstex ${input} ${outeps}
40
41 # Generate the PSTEX_T file
42 fig2dev -Lpstex_t -p${outbase} ${input} ${output}
43
44 # The end