File: fig2eps

package info (click to toggle)
getfem%2B%2B 5.3%2Bdfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 35,604 kB
  • sloc: cpp: 117,991; ansic: 73,600; fortran: 16,046; python: 7,403; sh: 3,624; perl: 1,722; makefile: 1,548
file content (78 lines) | stat: -rwxr-xr-x 3,209 bytes parent folder | download | duplicates (2)
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/bash
#
# Copyright (C) 1998-2017 Yves Renard
#
# This file is a part of GetFEM++
#
# GetFEM++  is  free software;  you  can  redistribute  it  and/or modify it
# under  the  terms  of the  GNU  Lesser General Public License as published
# by  the  Free Software Foundation;  either version 2.1 of the License,  or
# (at your option) any later version.
# This program  is  distributed  in  the  hope  that it will be useful,  but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or  FITNESS  FOR  A PARTICULAR PURPOSE.  See the GNU Lesser General Public
# License for more details.
# You  should  have received a copy of the GNU Lesser General Public License
# along  with  this program;  if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301, USA.

while (test $# -gt 0); do

export gg=`basename "$1" .fig`
export ff=`dirname "$1"`/${gg}

if !(test -f ${ff}.fig); then
  echo "Usage : fig2eps filename or fig2eps filename.fig"
  exit
fi

echo processing ${gg}.fig
# echo "xfig figure + latex formula --> eps. "

rm -f ${gg}.ps_0954236 ${gg}.tex_0954236 ${gg}_0954236.tex ${gg}_0954236.log
rm -f ${gg}_0954236.input ${gg}_0954236.aux  ${gg}_0954236.dvi missfont.log

# anciennement les rapports etaient -m0.9976 et -m1.04794
fig2dev -L pstex -m1.0 ${ff}.fig > ${gg}.ps_0954236
fig2dev -L pstex_t -m1.0 -p ${gg}.ps_0954236 ${ff}.fig > ${gg}.tex_0954236

echo "\\documentclass[a4paper,12pt,twoside]{article}" > ${gg}_0954236.tex
echo "\\usepackage{amsmath,amssymb}" >> ${gg}_0954236.tex
echo "\\usepackage[dvips]{color}" >> ${gg}_0954236.tex
echo "\\usepackage{amsfonts}" >> ${gg}_0954236.tex
echo "\\usepackage[dvips]{graphicx}" >> ${gg}_0954236.tex
echo "\\newfont{\\emtwelv}{cmr10 scaled 4}" >> ${gg}_0954236.tex
echo "\\pagestyle{empty}"  >> ${gg}_0954236.tex
echo "\\oddsidemargin -2.6cm"  >> ${gg}_0954236.tex
echo "\\evensidemargin -2.6cm"  >> ${gg}_0954236.tex
echo "\\topmargin -1cm"  >> ${gg}_0954236.tex
echo "\\textheight 29.7cm"  >> ${gg}_0954236.tex
echo "\\textwidth 21cm"  >> ${gg}_0954236.tex
echo "\\headheight 0cm"  >> ${gg}_0954236.tex
echo "\\newfont{\\msbmtwelve} {msbm10 scaled \\magstep1}" >> ${gg}_0954236.tex
echo "\\newcommand{\\ds}{\\displaystyle}" >> ${gg}_0954236.tex
echo "\\newcommand{\\Frac}[2]{{\\ds \\frac{\\ds #1}{\\ds #2}}}"  >> ${gg}_0954236.tex
echo "\\begin{document} \\noindent" >> ${gg}_0954236.tex
echo "{\\emtwelv \\textcolor{white}{.}}\\\\" >> ${gg}_0954236.tex
echo "\\mbox{\\input{"${gg}".tex_0954236}}" >> ${gg}_0954236.tex
echo "{\\emtwelv \\textcolor{white}{.}}" >> ${gg}_0954236.tex
echo "\\end{document}" >> ${gg}_0954236.tex
echo R > ${gg}_0954236.input

# rm -f ${gg}.log
latex ${gg}_0954236.tex < ${gg}_0954236.input > /dev/null
dvips -E ${gg}_0954236 -o ${gg}_0954236.ps >& /dev/null

mv -f ${gg}_0954236.ps ${gg}.eps

# la suite est pour quand l'inclusion de fichier compactes marchera en Latex ..
# rm -f ${gg}.eps.bb ${gg}.eps.gz
# grep %%BoundingBox ${gg}.eps > ${gg}.eps.bb
# gzip ${gg}.eps

rm -f ${gg}.ps_0954236 ${gg}.tex_0954236 ${gg}_0954236.tex ${gg}_0954236.log
rm -f ${gg}_0954236.input ${gg}_0954236.aux  ${gg}_0954236.dvi missfont.log


 shift 1
done