File: pstex2eps

package info (click to toggle)
plplot 5.10.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 26,280 kB
  • ctags: 13,512
  • sloc: ansic: 83,001; xml: 27,081; ada: 18,878; cpp: 15,966; tcl: 11,651; python: 7,075; f90: 7,058; ml: 6,974; java: 6,665; perl: 5,029; sh: 2,210; makefile: 199; lisp: 75; sed: 25; fortran: 7
file content (50 lines) | stat: -rwxr-xr-x 1,382 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/sh

# Generate an Encapsulated Postscript file (eps) from the
# PLplot pstex driver generated files.

if test $# = "0"; then
	echo -e "\n\
	Usage: pstex2eps <filename>\n\
	\n\
	Where <filename> is the name of the output file you specified\n\
	with the -o option in PLplot.\n\
	There must exist two files, the postscript file without text,\n\
	<filename>, and the latex file with the text, <filename_t>.\n\
	The output file will be named <filename.eps>.\n\
	\n\
	The Computer Modern Type 1 fonts will be included in the output\n\
	eps file. If you intent to use the plot figure in LaTeX, just\n\
	use a plain \include{<filename_t>} in your latex file.\n"
	exit 1
fi

if test ! -e $1 -o ! -e $1_t; then
	echo "$1 or $1_t don't exist. Exiting."
	exit 1
fi

ifile=$1
ofile=`mktemp pstex2eps.XXXXXX`

cat > ${ofile}.tex <<EOF
\documentclass{article}
\usepackage{ae,aecompl}
\usepackage{graphicx}
\begin{document}
\pagestyle{empty}
This is a  preview demo of your plot, the 'pstex' driver is intended 
to be used with \LaTeX.
Use \LaTeX math capabilities as strings in your plots,
and they will appear as you would expect.
\begin{figure}[!htb]
{\centering{\rotatebox{-90}{\scalebox{0.5}{\input{${ifile}_t}}}}
\caption{This is how your plot will look.}}
\end{figure}
\end{document}
EOF

latex ${ofile} > /dev/null \
&& dvips -Pcmz -o ${ifile}.eps $ofile 2> /dev/null 

rm ${ofile}*