[comp.sources.unix] v23i014: Tools for creating TeX documents with portable graphics, Part01/06

rsalz@bbn.com (Rich Salz) (08/31/90)

Submitted-by: Micah Beck <beck@cs.cornell.edu>
Posting-number: Volume 23, Issue 14
Archive-name: transfig/part01

TransFig is a set of tools for creating TeX documents with graphics
which are portable, in the sense that they can be printed in a wide
variety of environments.

The transfig directory contains the source for the transfig command
which generates a Makefile which translates Fig code to various graphics
description languages using the fig2dev program.  In previous releases,
this command was implemented as a shell script.

Drivers currently exist for the following graphics langauges:
(E)EPIC macros, LaTeX picture environment, PIC, PiCTeX, and PostScript.
Fig2dev can be configured with a subset of these drivers

XMicah Beck				beck@cs.cornell.edu
XDept of Computer Science
XCornell University

#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of archive 1 (of 6)."
# Contents:  transfig transfig/Makefile transfig/README
#   transfig/VERSION transfig/doc transfig/doc/manual
#   transfig/doc/manual/Makefile transfig/doc/manual/README
#   transfig/doc/manual/setup12.tex transfig/doc/manual/threepart.sty
#   transfig/doc/manual/trans.fig.uu transfig/doc/manual/trans.tex
#   transfig/doc/manual/transfig.tex transfig/doc/transfig.1
#   transfig/fig2dev transfig/fig2dev/Makefile transfig/fig2dev/NOTES
#   transfig/fig2dev/alloc.h transfig/fig2dev/arrow.c
#   transfig/fig2dev/dev transfig/fig2dev/dev/Makefile
#   transfig/fig2dev/dev/genbox.c transfig/fig2dev/dev/picfonts.h
#   transfig/fig2dev/dev/texfonts.h transfig/fig2dev/drivers.h
#   transfig/fig2dev/fig2dev.h transfig/fig2dev/fig2ps2tex
#   transfig/fig2dev/free.c transfig/fig2dev/getopt.c
#   transfig/fig2dev/newfont.h transfig/fig2dev/pi.h
#   transfig/fig2dev/pic2tpic transfig/patchlevel.h transfig/transfig
#   transfig/transfig/Makefile transfig/transfig/mkfile.c
#   transfig/transfig/sys.c transfig/transfig/transfig.c
#   transfig/transfig/transfig.h transfig/transfig/txfile.c
# Wrapped by beck@rocky on Thu May 17 15:56:10 1990
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test ! -d 'transfig' ; then
    echo shar: Creating directory \"'transfig'\"
    mkdir 'transfig'
fi
if test -f 'transfig/Makefile' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'transfig/Makefile'\"
else
echo shar: Extracting \"'transfig/Makefile'\" \(763 characters\)
sed "s/^X//" >'transfig/Makefile' <<'END_OF_FILE'
X#
X# Top level Makefile for TransFig
X#
X# to make fig2dev:         type "make"
X#
X# to install:              set  BINDIR in Makefile
X#			   type "make install"
X#
X# to make manual:          type "make manual"
X
X# directory in which to install executables
XBINDIR = /usr/local/bin
XMANDIR = /usr/local/man/man1
X
Xall:
X	cd transfig; make
X	cd fig2dev; make
X
Xmanual: 
X	cd doc/manual; make; latex manual; latex manual
X
Xinstall:	all
X	install -c -s transfig/transfig$(TARGET_ARCH) $(BINDIR)/transfig
X	install -c -s fig2dev/fig2dev$(TARGET_ARCH) $(BINDIR)/fig2dev
X	install -c fig2dev/fig2ps2tex $(BINDIR)
X	install -c fig2dev/pic2tpic $(BINDIR)
X	install -c doc/transfig.1 doc/fig2dev.1 $(MANDIR)
X
Xclean:
X	cd transfig; make clean
X	cd fig2dev; make clean
X	cd doc/manual; make clean
END_OF_FILE
if test 763 -ne `wc -c <'transfig/Makefile'`; then
    echo shar: \"'transfig/Makefile'\" unpacked with wrong size!
fi
# end of 'transfig/Makefile'
fi
if test -f 'transfig/README' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'transfig/README'\"
else
echo shar: Extracting \"'transfig/README'\" \(1513 characters\)
sed "s/^X//" >'transfig/README' <<'END_OF_FILE'
XTransFig is a set of tools for creating TeX documents with graphics
Xwhich are portable, in the sense that they can be printed in a wide
Xvariety of environments.
X
XThe transfig directory contains the source for the transfig command
Xwhich generates a Makefile which translates Fig code to various graphics
Xdescription languages using the fig2dev program.  In previous releases,
Xthis command was implemented as a shell script.
X
XThe fig2dev directory contains a general program for translating from
XFig code to other graphics desciption languages.  The dev subdirectory
Xcontains a library of output drivers used by fig2dev.
X
XDrivers currently exist for the following graphics langauges:
X(E)EPIC macros, LaTeX picture environment, PIC, PiCTeX, and PostScript.
XFig2dev can be configured with a subset of these drivers
X
XThe doc directory contains man pages for fig2dev and for the transfig command.
XThe subdirectory doc/manual contains a manual for using TransFig to create
Xdocuments with portable graphics.  The manual also contains a reference
Xguide describing Fig code in detail, and a description of TFX, an extension to
XFig code which is supported by the translators in this package.
X
XMicah Beck				beck@cs.cornell.edu
XDept of Computer Science
XCornell University
X
X1 January 1990
X--------------
X
XVersion 2.0 note: The PostScript translation implemented by fig2dev
Xnow supports both the TFX version of Fig code and the V2.0, the dialect
Xused by XFig Version 2.0.  The other translations support only TFX.
X
X1 May 1990
X
END_OF_FILE
if test 1513 -ne `wc -c <'transfig/README'`; then
    echo shar: \"'transfig/README'\" unpacked with wrong size!
fi
# end of 'transfig/README'
fi
if test -f 'transfig/VERSION' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'transfig/VERSION'\"
else
echo shar: Extracting \"'transfig/VERSION'\" \(31 characters\)
sed "s/^X//" >'transfig/VERSION' <<'END_OF_FILE'
XTransFig Version 2.0 Release 1
END_OF_FILE
if test 31 -ne `wc -c <'transfig/VERSION'`; then
    echo shar: \"'transfig/VERSION'\" unpacked with wrong size!
fi
# end of 'transfig/VERSION'
fi
if test ! -d 'transfig/doc' ; then
    echo shar: Creating directory \"'transfig/doc'\"
    mkdir 'transfig/doc'
fi
if test ! -d 'transfig/doc/manual' ; then
    echo shar: Creating directory \"'transfig/doc/manual'\"
    mkdir 'transfig/doc/manual'
fi
if test -f 'transfig/doc/manual/Makefile' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'transfig/doc/manual/Makefile'\"
else
echo shar: Extracting \"'transfig/doc/manual/Makefile'\" \(219 characters\)
sed "s/^X//" >'transfig/doc/manual/Makefile' <<'END_OF_FILE'
X# 
X# Makefile: TransFig makefile for translation of figures into latex
X# 
X 
Xall: tex-list
X 
Xtrans.tex: trans.fig
X	fig2dev -Llatex  trans.fig trans.tex
X 
Xtex-list: trans.tex
Xtrans.tex: Makefile
X 
Xclean:
X	rm -f trans.tex
END_OF_FILE
if test 219 -ne `wc -c <'transfig/doc/manual/Makefile'`; then
    echo shar: \"'transfig/doc/manual/Makefile'\" unpacked with wrong size!
fi
# end of 'transfig/doc/manual/Makefile'
fi
if test -f 'transfig/doc/manual/README' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'transfig/doc/manual/README'\"
else
echo shar: Extracting \"'transfig/doc/manual/README'\" \(434 characters\)
sed "s/^X//" >'transfig/doc/manual/README' <<'END_OF_FILE'
XThis directory contains a manual which describes TransFig and how to use it.
XThe manual includes TransFig figures, which have been translated into
XLaTeX picture environment commands.  To generate the manual, just run
X"latex manual".
X
XFor purposes of mailing, the Fig code file trans.fig may have been 
Xommited from this directory.  In its place is the uuencoded version
Xtrans.fig.uu.  To unpack it, just run "uudecode <trans.fig.uu".
END_OF_FILE
if test 434 -ne `wc -c <'transfig/doc/manual/README'`; then
    echo shar: \"'transfig/doc/manual/README'\" unpacked with wrong size!
fi
# end of 'transfig/doc/manual/README'
fi
if test -f 'transfig/doc/manual/setup12.tex' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'transfig/doc/manual/setup12.tex'\"
else
echo shar: Extracting \"'transfig/doc/manual/setup12.tex'\" \(1385 characters\)
sed "s/^X//" >'transfig/doc/manual/setup12.tex' <<'END_OF_FILE'
X% Set up LaTeX for an article.
X% This should work for LaTeX 2.08.
X% This file contains everything up to
X% the \begin{document} command,
X% and should be read in with an \input command.
X\documentstyle[12pt,threepart]{article}
X
X% Formatting niceties.
X
X% ensure that all pages are the same length
X\flushbottom{}
X
X% bump up the widow and club penalties
X\makeatletter
X\clubpenalty=\@highpenalty
X\widowpenalty=\@highpenalty
X\makeatother
X
X% save the value of \baselinestretch (this is the global default)
X\let\BLS=\baselinestretch
X 
X% These allow switching interline spacing.  The size changes ensure that the
X% change takes effect immediately.
X\makeatletter
X\newcommand{\singlespacing}{\let\CS=\@currsize\renewcommand{\baselinestretch}{1}\tiny\CS}
X\newcommand{\doublespacing}{\let\CS=\@currsize\renewcommand{\baselinestretch}{1.75}\tiny\CS}
X\newcommand{\normalspacing}{\let\CS=\@currsize\renewcommand{\baselinestretch}{\BLS}\tiny\CS}
X\makeatother
X
X% undo LaTeX's decision to make citation labels be \hbox'd.
X\makeatletter
X\def\@cite#1#2{[#1\if@tempswa , #2\fi]}
X\makeatother
X
X
X\setlength{\unitlength}{1mm}
X
X% Number footnotes with symbols.
X\fnsymbol{footnote}
X
X\newtheorem{theorem}{Theorem}
X\newtheorem{lemma}{Lemma}
X\newtheorem{corollary}{Corollary}
X\newtheorem{definition}{Definition}
X
X% Definition of the proof-environment:
X\newenvironment{proof}{{\bf Proof:}\quad}{\hfill$\Box$\newline}
X
END_OF_FILE
if test 1385 -ne `wc -c <'transfig/doc/manual/setup12.tex'`; then
    echo shar: \"'transfig/doc/manual/setup12.tex'\" unpacked with wrong size!
fi
# end of 'transfig/doc/manual/setup12.tex'
fi
if test -f 'transfig/doc/manual/threepart.sty' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'transfig/doc/manual/threepart.sty'\"
else
echo shar: Extracting \"'transfig/doc/manual/threepart.sty'\" \(1428 characters\)
sed "s/^X//" >'transfig/doc/manual/threepart.sty' <<'END_OF_FILE'
X% Three part head and foot macros. 1/87
X% Lance Berc
X% Olsen & Associates	mcvax!unizh!olsen!lance@seismo.css.gov
X% Seefeldstrasse 233
X% CH-8008 Zurich
X
X% How users can set the head and foot text.
X\def\lhead#1{\gdef\@lhead{#1}} \def\lfoot#1{\gdef\@lfoot{#1}}
X\def\chead#1{\gdef\@chead{#1}} \def\cfoot#1{\gdef\@cfoot{#1}}
X\def\rhead#1{\gdef\@rhead{#1}} \def\rfoot#1{\gdef\@rfoot{#1}}
X
X% Initialization of the head and foot text.
X% By default the page number is at the center of the foot and everything
X% else is empty.
X\def\@lhead{} \def\@lfoot{}
X\def\@chead{} \def\@cfoot{{\rm \thepage}}
X\def\@rhead{} \def\@rfoot{}
X
X% Put together a three part header or footer given the left, center and
X% right text. The \lap commands put the text into an hbox of zero size,
X% so overlapping text is not detected (it just overlaps).
X\def\@threepart#1#2#3{\rlap{#1} \hfil {#2} \hfil \llap{#3}}
X
X% Swap the notices on odd and even pages when twosided.
X\def\ps@threepartheadings
X    {
X    \def\@oddhead{\@threepart{\@lhead}{\@chead}{\@rhead}}
X    \def\@oddfoot{\@threepart{\@lfoot}{\@cfoot}{\@rfoot}}
X
X    \if@twoside
X	\def\@evenhead{\@threepart{\@rhead}{\@chead}{\@lhead}}
X	\def\@evenfoot{\@threepart{\@rfoot}{\@cfoot}{\@lfoot}}
X    \else
X	\def\@evenhead{\@threepart{\@lhead}{\@chead}{\@rhead}}
X	\def\@evenfoot{\@threepart{\@lfoot}{\@cfoot}{\@rfoot}}
X    \fi
X    }
X
X% Default page style
X\ps@threepartheadings
X
X% Default footers
X\cfoot{\thepage}
END_OF_FILE
if test 1428 -ne `wc -c <'transfig/doc/manual/threepart.sty'`; then
    echo shar: \"'transfig/doc/manual/threepart.sty'\" unpacked with wrong size!
fi
# end of 'transfig/doc/manual/threepart.sty'
fi
if test -f 'transfig/doc/manual/trans.fig.uu' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'transfig/doc/manual/trans.fig.uu'\"
else
echo shar: Extracting \"'transfig/doc/manual/trans.fig.uu'\" \(3346 characters\)
sed "s/^X//" >'transfig/doc/manual/trans.fig.uu' <<'END_OF_FILE'
Xbegin 644 trans.fig
XM(T9)1R Q+C0M5$98"C@P(#(*,B Q(# @,2 P(# @," P(# N,# P(#$@, H)
XM," P(#$N,# P(#0N,# P(#@N,# P"@D@-#,Y(#$Y-" S,SD@,C$Y(#DY.3D@
XM.3DY.0HR(#$@," Q(# @," P(# @,"XP,# @,2 P"@DP(# @,2XP,# @-"XP
XM,# @."XP,# *"2 Q-3D@,3DT(#(U.2 R,3D@.3DY.2 Y.3DY"C(@,B Q(#$@
XM," P(# @," T+C P," P(# *"2 T-CD@,3<P(#0V.2 Q.#D@-# Y(#$X.2 T
XM,#D@,3<P(#0V.2 Q-S @.3DY.2 Y.3DY"C(@,2 P(#$@," P(# @," P+C P
XM," Q(# *"3 @," Q+C P," T+C P," X+C P, H)(#,Q-2 R.#(@,S@U(#,Q
XM-R Y.3DY(#DY.3D*,B Q(# @,2 P(# @," P(# N,# P(#$@, H)," P(#$N
XM,# P(#0N,# P(#@N,# P"@D@,CDY(#(S.2 R.3D@,C4T(#DY.3D@.3DY.0HR
XM(#$@," Q(# @," P(# @-"XP,# @,2 P"@DP(# @,2XP,# @-"XP,# @."XP
XM,# *"2 R-3<@,C@P(#$T," S,3D@.3DY.2 Y.3DY"C(@,2 P(#$@," P(# @
XM," T+C P," Q(# *"3 @," Q+C P," T+C P," X+C P, H)(#(X,R R.#(@
XM,C$S(#,Q-R Y.3DY(#DY.3D*,B Q(# @,2 P(# @," P(#0N,# P(#$@, H)
XM," P(#$N,# P(#0N,# P(#@N,# P"@D@,CDY(#(X,B R.3D@,S$W(#DY.3D@
XM.3DY.0HR(#(@," Q(# @-3$Y(# @," P+C P," P(# *"2 R-CD@,C4Y(#(V
XM.2 R-SD@,S(Y(#(W.2 S,CD@,C4Y(#(V.2 R-3D@.3DY.2 Y.3DY"C(@,2 P
XM(#$@," P(# @," T+C P," Q(# *"3 @," Q+C P," T+C P," X+C P, H)
XM(#,S.2 R-SD@-#4Y(#,Q.2 Y.3DY(#DY.3D*,B Q(# @,2 P(# @," P(# N
XM,# P(#$@, H)," P(#$N,# P(#0N,# P(#@N,# P"@D@,CDY(#$Y-" R.3D@
XM,C$Y(#DY.3D@.3DY.0HR(#$@," Q(# @," P(# @,"XP,# @," Q"@DP(# @
XM,2XP,# @-"XP,# @."XP,# *"2 S,3D@,C$Y(#,V.2 Q.30@.3DY.2 Y.3DY
XM"C(@,2 P(#$@," P(# @," P+C P," Q(# *"3 @," Q+C P," T+C P," X
XM+C P, H)(#(R.2 Q.30@,C<Y(#(Q.2 Y.3DY(#DY.3D*,B Q(# @,2 P(# @
XM," P(#0N,# P(#$@, H)," P(#$N,# P(#0N,# P(#@N,# P"@D@-#4Y(#,T
XM," T-3D@,S4U(#DY.3D@.3DY.0HR(#(@,2 Q(# @," P(# @-"XP,# @," P
XM"@D@-#@Y(#,U.2 T.#D@,S<Y(#0R.2 S-SD@-#(Y(#,U.2 T.#D@,S4Y(#DY
XM.3D@.3DY.0HR(#$@," Q(# @," P(# @-"XP,# @,2 P"@DP(# @,2XP,# @
XM-"XP,# @."XP,# *"2 T-3D@,S@T(#0U.2 S.3D@.3DY.2 Y.3DY"C(@,B Q
XM(#$@," P(# @," T+C P," P(# *"2 Q.#D@,3<P(#$X.2 Q.#D@,3(Y(#$X
XM.2 Q,CD@,3<P(#$X.2 Q-S @.3DY.2 Y.3DY"C(@,B Q(#$@," U,3D@," P
XM(#0N,# P(# @, H)(#(U.2 Q-CD@,C4Y(#$X.2 Q.3D@,3@Y(#$Y.2 Q-CD@
XM,C4Y(#$V.2 Y.3DY(#DY.3D*,B R(#$@,2 P(# @," P(#0N,# P(# @, H)
XM(#,R.2 Q-S @,S(Y(#$X.2 R-CD@,3@Y(#(V.2 Q-S @,S(Y(#$W," Y.3DY
XM(#DY.3D*,B R(#$@,2 P(# @," P(#0N,# P(# @, H)(#,Y.2 Q-S @,SDY
XM(#$X.2 S,SD@,3@Y(#,S.2 Q-S @,SDY(#$W," Y.3DY(#DY.3D*-" Q(# @
XM," P(# @," P+C P," P(#$V(#8T(#0S.2 Q.#(@>&%P9W)A<&@!"C0@,2 P
XM(# @," P(# @,"XP,# @," Q-B U-B R,CD@,3@R(&=N=7!L;W0!"C0@,2 P
XM(# @," P(# @,"XP,# @," Q-B V-" S-CD@,3@R('!L;W0R9FEG 0HT(#$@
XM," P(# @," P(# N,# P(#$@,38@-38@,CDY(#(W,R!F:6<R9&5V 0HT(#$@
XM,2 P(# @," P(# N,# P(#$@,38@-C0@,S<Y(#,T.2!C;VUM86YD<P$*-" Q
XM(#$@," P(# @," P+C P," Q(#$V(#4V(#,W.2 S,S,@*$4I15!)0P$*-" Q
XM(#$@," P(# @," P+C P," P(#$V(#0X(#(Q.2 S-#@@4V-R:7!T 0HT(#$@
XM,2 P(# @," P(# N,# P(# @,38@,S(@,C$Y(#,S,B!0;W-T 0HT(#$@,2 P
XM(# @," P(# N,# P(# @,38@-#@@,3,V(#,S,R!0:4-495@!"C0@,2 Q(# @
XM," P(# @,"XP,# @," Q-B T." Q,S<@,S0X(&UA8W)O<P$*-" Q(#$@," P
XM(# @," P+C P," Q(#$V(#0P(#(Y.2 S,S,@3&%495@!"C0@,2 Q(# @," P
XM(# @,"XP,# @,2 Q-B V-" R.3D@,S0Y(&-O;6UA;F1S 0HT(#$@,2 P(# @
XM," P(# N,# P(# @,38@-C0@,S Q(#(S,R!&:6<@8V]D90$*-" Q(#$@," P
XM(# @," P+C P," Q(#$V(#,R(#0U.2 T,3,@='!I8P$*-" Q(#$@," P(# @
XM," P+C P," Q(#$V(#8T(#0U.2 T,S @<W!E8VEA;',!"C0@,2 Q(# @," P
XM(# @,"XP,# @,2 Q-B R-" T-3D@,S,S(%!)0P$*-" Q(# @," P(# @," P
XM+C P," Q(#$V(#,R(#0U.2 S-S(@='!I8P$*-" Q(# @," P(# @," P+C P
XM," P(#$V(#(T(#$U.2 Q.#(@9FEG 0HT(#$@," P(# @," P(# N,# P(# @
X7,38@-38@,CDY(#$X,B!P:6,R9FEG 0HT
X 
Xend
END_OF_FILE
if test 3346 -ne `wc -c <'transfig/doc/manual/trans.fig.uu'`; then
    echo shar: \"'transfig/doc/manual/trans.fig.uu'\" unpacked with wrong size!
fi
# end of 'transfig/doc/manual/trans.fig.uu'
fi
if test -f 'transfig/doc/manual/trans.tex' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'transfig/doc/manual/trans.tex'\"
else
echo shar: Extracting \"'transfig/doc/manual/trans.tex'\" \(2190 characters\)
sed "s/^X//" >'transfig/doc/manual/trans.tex' <<'END_OF_FILE'
X\setlength{\unitlength}{0.0125in}%
X\begin{picture}(379,264)(113,409)
X\thicklines
X\put(270,560){\framebox(60,20){}}
X\put(200,650){\dashbox{4}(60,20){}}
X\put(258,559){\vector(-3,-1){117}}
X\put(410,650){\dashbox{4}(60,19){}}
X\put(316,557){\vector( 2,-1){ 70}}
X\put(300,600){\vector( 0,-1){ 15}}
X\put(284,557){\vector(-2,-1){ 70}}
X\put(300,557){\vector( 0,-1){ 35}}
X\put(160,645){\vector( 4,-1){100}}
X\put(440,645){\vector(-4,-1){100}}
X\put(300,645){\vector( 0,-1){ 25}}
X\put(370,645){\vector(-2,-1){ 50}}
X\put(230,645){\vector( 2,-1){ 50}}
X\put(460,499){\vector( 0,-1){ 15}}
X\put(430,460){\dashbox{4}(60,20){}}
X\put(460,455){\vector( 0,-1){ 15}}
X\put(130,650){\dashbox{4}(60,19){}}
X\put(340,560){\vector( 3,-1){120}}
X\put(270,650){\dashbox{4}(60,19){}}
X\put(340,650){\dashbox{4}(60,19){}}
X\put(440,657){\makebox(0,0)[b]{\raisebox{0pt}[0pt][0pt]{\elvrm xapgraph}}}
X\put(230,657){\makebox(0,0)[b]{\raisebox{0pt}[0pt][0pt]{\elvrm gnuplot}}}
X\put(370,657){\makebox(0,0)[b]{\raisebox{0pt}[0pt][0pt]{\elvrm plot2fig}}}
X\put(300,566){\makebox(0,0)[b]{\raisebox{0pt}[0pt][0pt]{\elvrm fig2dev}}}
X\put(380,490){\makebox(0,0)[b]{\raisebox{0pt}[0pt][0pt]{\elvrm commands}}}
X\put(380,506){\makebox(0,0)[b]{\raisebox{0pt}[0pt][0pt]{\elvrm (E)EPIC}}}
X\put(220,491){\makebox(0,0)[b]{\raisebox{0pt}[0pt][0pt]{\elvrm Script}}}
X\put(220,507){\makebox(0,0)[b]{\raisebox{0pt}[0pt][0pt]{\elvrm Post}}}
X\put(137,506){\makebox(0,0)[b]{\raisebox{0pt}[0pt][0pt]{\elvrm PiCTeX}}}
X\put(138,491){\makebox(0,0)[b]{\raisebox{0pt}[0pt][0pt]{\elvrm macros}}}
X\put(300,506){\makebox(0,0)[b]{\raisebox{0pt}[0pt][0pt]{\elvrm LaTeX}}}
X\put(300,490){\makebox(0,0)[b]{\raisebox{0pt}[0pt][0pt]{\elvrm commands}}}
X\put(302,606){\makebox(0,0)[b]{\raisebox{0pt}[0pt][0pt]{\elvrm Fig code}}}
X\put(460,426){\makebox(0,0)[b]{\raisebox{0pt}[0pt][0pt]{\elvrm tpic}}}
X\put(460,409){\makebox(0,0)[b]{\raisebox{0pt}[0pt][0pt]{\elvrm specials}}}
X\put(460,506){\makebox(0,0)[b]{\raisebox{0pt}[0pt][0pt]{\elvrm PIC}}}
X\put(460,467){\makebox(0,0)[b]{\raisebox{0pt}[0pt][0pt]{\elvrm tpic}}}
X\put(160,657){\makebox(0,0)[b]{\raisebox{0pt}[0pt][0pt]{\elvrm fig}}}
X\put(300,657){\makebox(0,0)[b]{\raisebox{0pt}[0pt][0pt]{\elvrm pic2fig}}}
X\end{picture}
END_OF_FILE
if test 2190 -ne `wc -c <'transfig/doc/manual/trans.tex'`; then
    echo shar: \"'transfig/doc/manual/trans.tex'\" unpacked with wrong size!
fi
# end of 'transfig/doc/manual/trans.tex'
fi
if test -f 'transfig/doc/manual/transfig.tex' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'transfig/doc/manual/transfig.tex'\"
else
echo shar: Extracting \"'transfig/doc/manual/transfig.tex'\" \(38 characters\)
sed "s/^X//" >'transfig/doc/manual/transfig.tex' <<'END_OF_FILE'
X\typeout{TransFig: figures in LaTeX.}
END_OF_FILE
if test 38 -ne `wc -c <'transfig/doc/manual/transfig.tex'`; then
    echo shar: \"'transfig/doc/manual/transfig.tex'\" unpacked with wrong size!
fi
# end of 'transfig/doc/manual/transfig.tex'
fi
if test -f 'transfig/doc/transfig.1' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'transfig/doc/transfig.1'\"
else
echo shar: Extracting \"'transfig/doc/transfig.1'\" \(1886 characters\)
sed "s/^X//" >'transfig/doc/transfig.1' <<'END_OF_FILE'
X.TH TRANSFIG 1 "29 March 1989"
X.SH NAME
Xtransfig \- creates a makefile for portable LaTeX figures
X.SH SYNOPSIS
X.B transfig
X[ -L \fIlanguage\fR ]
X[ -M \fImakefile\fR ]
X[ -T \fItexfile\fR ]
X[ \fIcontrol_specs\fR figfile ... ] ...]
X.SH DESCRIPTION
X.I Transfig
Xcreates a makefile to translate figures described in Fig code, PostScript,
Xor PIC into a specified LaTeX graphics \fIlanguage\fR.
XPostScript and PIC files are identified by the suffixes ".ps" and ".pic"
Xrespectively;
XFig files can be specified either with or without the suffix ".fig" .
XTransfig also creates a TeX macro file appropriate to the target language.
X.SH OPTIONS
XThe \fIlanguage\fR specifier must be either
X.T
X.BR epic ,
X.BR eepic ,
X.BR eepicemu ,
X.BR latex ,
X.BR pictex ,
X.BR ps ,
X.BR psfig ,
X.BR tpic ,
Xor
X.BR null .
XThe specifier
X.B psfig
Xis like the 
X.B ps
Xspecifier, except that it
Xmake use of the psfig macro package.
XThe specifier 
X.B null
Xresults in the figures being replaced by empty boxes of the
Xappropriate size.
XIf no language is specified,
X.B epic
Xis the default.
X.PP
XThe names of the makefile and TeX macro file can be set with the
X-M and -T options.
XThe default names are "Makefile" and "transfig.tex", respectively.
X.PP
XControl specifiers are 
X.TP
X\fB\-m\fI mag\fR
Xset the magnification at which the figure is rendered (default 1.0).
X.TP
X\fB\-f\fI font\fR
Xset the default font family used for text objects (default "\fBcmr\fR").
X.TP
X\fB\-s \fIfontsize\fR
Xset the default font size (in points) for text objects (default 11*\fImag\fR).
X.PP
XIf there is no scaling, the default font is "\fB\\elvrm\fR".
XLanguage and control specifiers may occur more than once;
Xthey affect the translation of files which appear to their
Xright in the argument list. 
XIf no files are specified, then "*.fig" is assumed.
X.SH "SEE ALSO"
Xfig(1),
Xfig2dev(1),
Xpic(1),
Xpic2fig(1),
X.SH AUTHOR
XMicah Beck (beck@svax.cs.cornell.edu)
END_OF_FILE
if test 1886 -ne `wc -c <'transfig/doc/transfig.1'`; then
    echo shar: \"'transfig/doc/transfig.1'\" unpacked with wrong size!
fi
# end of 'transfig/doc/transfig.1'
fi
if test ! -d 'transfig/fig2dev' ; then
    echo shar: Creating directory \"'transfig/fig2dev'\"
    mkdir 'transfig/fig2dev'
fi
if test -f 'transfig/fig2dev/Makefile' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'transfig/fig2dev/Makefile'\"
else
echo shar: Extracting \"'transfig/fig2dev/Makefile'\" \(784 characters\)
sed "s/^X//" >'transfig/fig2dev/Makefile' <<'END_OF_FILE'
X#	Fig2dev : General Fig code translation program
X#
X#	Micah Beck
X#	Modified from f2ps
X#
X
X#
X# to include drivers for the following langauges, 
X# add the corresponding symbol to the DRIVERS list
X#
X# DRIVERS = -DEPIC -DLATEX -DPIC  -DPICTEX -DPS
X#
XDRIVERS = -DEPIC -DLATEX -DPIC  -DPICTEX -DPS
X
XFIGOBJ = arrow.o bound.o free.o read.o read1_3.o latex_line.o
XOBJ = fig2dev.o getopt.o $(FIGOBJ)
X
XLIB = lib$(TARGET_ARCH).a
XLIBS = dev/$(LIB)
X
X#CFLAGS =  -g $(DRIVERS)
XCFLAGS = -O $(DRIVERS)
X
XTARGET = fig2dev$(TARGET_ARCH)
X
X$(TARGET): $(OBJ) $(LIBS) 
X	$(CC) $(TARGET_ARCH) $(OBJ) $(LIBS) -lm -o $(TARGET)
X
X$(LIBS): always
X	(cd dev; make)
X
X$(OBJ): fig2dev.h drivers.h
X
X
X#########
Xalways:
X
Xtidy: 
X	rm -f *.o
X	(cd dev; make tidy)
X
Xclean : 
X	rm -f *.o fig2dev fig2dev-* core
X	(cd dev; make clean)
END_OF_FILE
if test 784 -ne `wc -c <'transfig/fig2dev/Makefile'`; then
    echo shar: \"'transfig/fig2dev/Makefile'\" unpacked with wrong size!
fi
# end of 'transfig/fig2dev/Makefile'
fi
if test -f 'transfig/fig2dev/NOTES' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'transfig/fig2dev/NOTES'\"
else
echo shar: Extracting \"'transfig/fig2dev/NOTES'\" \(1019 characters\)
sed "s/^X//" >'transfig/fig2dev/NOTES' <<'END_OF_FILE'
XA brief history of Fig translation programs.
X
XFig2dev is derived from f2p, the original program written by the author of Fig,
XSupoj Sutanthavibul of the University of Texas at Austin, to translate Fig
Xcode to PIC.  The devlopment is somewhat complex.
X
XSupoj adapted f2p for PostScript ouput: f2ps.
X
XI adapted f2p for PiCTeX output: fig2tex.
X
XFrank Schmuck, then a graduate student at Cornell, adapted fig2tex for
XLaTeX picture environment output: fig2latex.
X
XFrank also enhanced Fig, giving us Fig-FS.  I in turn extended the
Xdefinition of Fig code and added corresponding features to Fig-FS.
XI implemented this extension (TFX) in fig2tex, and in fig2ps, which
Xis an adaption of f2ps.
X
XConrad Kwok, then of the University of California at Davis, adapted
Xfig2tex for (E)EPIC output: fig2epic.
X
XHe also enhanced f2p to support the TFX extension: fig2pic.
X
XI have now reorganized the five programs named fig2* into drivers for
Xa single tranlation program: fig2dev.
X
XMicah Beck
XCornell Dept. of Computer Science
X6 May 1989
END_OF_FILE
if test 1019 -ne `wc -c <'transfig/fig2dev/NOTES'`; then
    echo shar: \"'transfig/fig2dev/NOTES'\" unpacked with wrong size!
fi
# end of 'transfig/fig2dev/NOTES'
fi
if test -f 'transfig/fig2dev/alloc.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'transfig/fig2dev/alloc.h'\"
else
echo shar: Extracting \"'transfig/fig2dev/alloc.h'\" \(640 characters\)
sed "s/^X//" >'transfig/fig2dev/alloc.h' <<'END_OF_FILE'
Xextern char	*malloc();
Xextern char	*calloc();
X
X#define		Line_malloc(z)		z = (F_line*)malloc(LINOBJ_SIZE)
X#define		Spline_malloc(z)	z = (F_spline*)malloc(SPLOBJ_SIZE)
X#define		Ellipse_malloc(z)	z = (F_ellipse*)malloc(ELLOBJ_SIZE)
X#define		Arc_malloc(z)		z = (F_arc*)malloc(ARCOBJ_SIZE)
X#define		Compound_malloc(z)	z = (F_compound*)malloc(COMOBJ_SIZE)
X#define		Text_malloc(z)		z = (F_text*)malloc(TEXOBJ_SIZE)
X#define		Point_malloc(z)		z = (F_point*)malloc(POINT_SIZE)
X#define		Control_malloc(z)	z = (F_control*)malloc(CONTROL_SIZE)
X#define		Arrow_malloc(z)		z = (F_arrow*)malloc(ARROW_SIZE)
X
Xextern char	Err_mem[];
Xextern char	Err_incomp[];
END_OF_FILE
if test 640 -ne `wc -c <'transfig/fig2dev/alloc.h'`; then
    echo shar: \"'transfig/fig2dev/alloc.h'\" unpacked with wrong size!
fi
# end of 'transfig/fig2dev/alloc.h'
fi
if test -f 'transfig/fig2dev/arrow.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'transfig/fig2dev/arrow.c'\"
else
echo shar: Extracting \"'transfig/fig2dev/arrow.c'\" \(1366 characters\)
sed "s/^X//" >'transfig/fig2dev/arrow.c' <<'END_OF_FILE'
X#include <stdio.h>
X#include "alloc.h"
X#include "object.h"
X
Xstatic double		forward_arrow_wid = 4;
Xstatic double		forward_arrow_ht = 8;
Xstatic int		forward_arrow_type = 0;
Xstatic int		forward_arrow_style = 0;
Xstatic double		forward_arrow_thickness = 1;
X
Xstatic double		backward_arrow_wid = 4;
Xstatic double		backward_arrow_ht = 8;
Xstatic int		backward_arrow_type = 0;
Xstatic int		backward_arrow_style = 0;
Xstatic double		backward_arrow_thickness = 1;
X
XF_arrow *
Xforward_arrow()
X{
X	F_arrow		*a;
X
X	if (NULL == (Arrow_malloc(a))) {
X	    put_msg(Err_mem);
X	    return(NULL);
X	    }
X	a->type = forward_arrow_type;
X	a->style = forward_arrow_style;
X	a->thickness = forward_arrow_thickness;
X	a->wid = forward_arrow_wid;
X	a->ht = forward_arrow_ht;
X	return(a);
X	}
X
XF_arrow *
Xbackward_arrow()
X{
X	F_arrow		*a;
X
X	if (NULL == (Arrow_malloc(a))) {
X	    put_msg(Err_mem);
X	    return(NULL);
X	    }
X	a->type = backward_arrow_type;
X	a->style = backward_arrow_style;
X	a->thickness = backward_arrow_thickness;
X	a->wid = backward_arrow_wid;
X	a->ht = backward_arrow_ht;
X	return(a);
X	}
X
XF_arrow *
Xmake_arrow(type, style, thickness, wid, ht)
Xint	type, style;
Xdouble	thickness, wid, ht;
X{
X	F_arrow		*a;
X
X	if (NULL == (Arrow_malloc(a))) {
X	    put_msg(Err_mem);
X	    return(NULL);
X	    }
X	a->type = type;
X	a->style = style;
X	a->thickness = thickness;
X	a->wid = wid;
X	a->ht = ht;
X	return(a);
X	}
END_OF_FILE
if test 1366 -ne `wc -c <'transfig/fig2dev/arrow.c'`; then
    echo shar: \"'transfig/fig2dev/arrow.c'\" unpacked with wrong size!
fi
# end of 'transfig/fig2dev/arrow.c'
fi
if test ! -d 'transfig/fig2dev/dev' ; then
    echo shar: Creating directory \"'transfig/fig2dev/dev'\"
    mkdir 'transfig/fig2dev/dev'
fi
if test -f 'transfig/fig2dev/dev/Makefile' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'transfig/fig2dev/dev/Makefile'\"
else
echo shar: Extracting \"'transfig/fig2dev/dev/Makefile'\" \(312 characters\)
sed "s/^X//" >'transfig/fig2dev/dev/Makefile' <<'END_OF_FILE'
X#
X#	Fig2dev Driver Library Makefile
X#
X
XINCLUDES = -I..
X#CFLAGS = -g $(INCLUDES)
XCFLAGS =  -O $(INCLUDES)
X
XOBJ =  genps.o genlatex.o genepic.o genpictex.o genpic.o genbox.o
XLIB = lib$(TARGET_ARCH).a
X
X$(LIB) : $(OBJ)
X	ar r $(LIB) $(OBJ)
X	ranlib $(LIB)
X
X#########
Xtidy: 
X	rm -f *.o
X
Xclean :
X	rm -f *.o core lib*.a
X
END_OF_FILE
if test 312 -ne `wc -c <'transfig/fig2dev/dev/Makefile'`; then
    echo shar: \"'transfig/fig2dev/dev/Makefile'\" unpacked with wrong size!
fi
# end of 'transfig/fig2dev/dev/Makefile'
fi
if test -f 'transfig/fig2dev/dev/genbox.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'transfig/fig2dev/dev/genbox.c'\"
else
echo shar: Extracting \"'transfig/fig2dev/dev/genbox.c'\" \(800 characters\)
sed "s/^X//" >'transfig/fig2dev/dev/genbox.c' <<'END_OF_FILE'
X/* 
X *	genbox : Empty box driver for fig2dev translator
X *
X*/
X#include <stdio.h>
X#include "object.h"
X#include "fig2dev.h"
X
Xvoid genbox_option(opt, optarg)
Xchar opt, *optarg;
X{
X  	switch (opt) {
X
X	case 's':
X	case 'f':
X	case 'm':
X	case 'L':
X		break;
X
X 	default:
X		put_msg(Err_badarg, opt, "box");
X		exit(1);
X	}
X}
X
Xvoid genbox_start(objects)
XF_compound	*objects;
X{
X	double ppi;
X
X	if (0 == (ppi = (double)objects->nwcorner.x)) {
X	    fprintf(stderr, "Resolution is zero!! default to 80 ppi\n");
X	    ppi = 80.0;
X	    }
X
X	/* draw box */
X        fprintf(tfp, "\\makebox[%.3fin]{\\rule{0in}{%.3fin}}\n",
X		(urx-llx)*mag/ppi, (ury-lly)*mag/ppi);
X	}
X
Xstruct driver dev_box = {
X	genbox_option,
X	genbox_start,
X	gendev_null,
X	gendev_null,
X	gendev_null,
X	gendev_null,
X	gendev_null,
X	gendev_null,
X	INCLUDE_TEXT
X};
END_OF_FILE
if test 800 -ne `wc -c <'transfig/fig2dev/dev/genbox.c'`; then
    echo shar: \"'transfig/fig2dev/dev/genbox.c'\" unpacked with wrong size!
fi
# end of 'transfig/fig2dev/dev/genbox.c'
fi
if test -f 'transfig/fig2dev/dev/picfonts.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'transfig/fig2dev/dev/picfonts.h'\"
else
echo shar: Extracting \"'transfig/fig2dev/dev/picfonts.h'\" \(458 characters\)
sed "s/^X//" >'transfig/fig2dev/dev/picfonts.h' <<'END_OF_FILE'
X/*  The selection of font names may be site dependent */
X
Xchar		*fontnames[] = {
X			"R", "R",		/* default */
X			"R",			/* roman */
X			"B",			/* bold */
X			"I",			/* italic */
X			"H",			/* sans serif */
X			"C"			/* typewriter */
X		};
X#define MAXFONT 5
X#define MAXFONTSIZE 108
X
X#define PICFONT(F)	(fontnames[((F) <= MAXFONT) ? (F)+1 : MAXFONT])
X#define PICFONTSIZE(S)  ((S) > 0 ? \
X				((S) <= MAXFONTSIZE ? \
X					(S) : \
X					MAXFONTSIZE) : \
X				font_size)
END_OF_FILE
if test 458 -ne `wc -c <'transfig/fig2dev/dev/picfonts.h'`; then
    echo shar: \"'transfig/fig2dev/dev/picfonts.h'\" unpacked with wrong size!
fi
# end of 'transfig/fig2dev/dev/picfonts.h'
fi
if test -f 'transfig/fig2dev/dev/texfonts.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'transfig/fig2dev/dev/texfonts.h'\"
else
echo shar: Extracting \"'transfig/fig2dev/dev/texfonts.h'\" \(815 characters\)
sed "s/^X//" >'transfig/fig2dev/dev/texfonts.h' <<'END_OF_FILE'
Xstatic char		*fontnames[] = {
X			"rm", "rm",		/* default */
X			"rm",			/* roman */
X			"bf",			/* bold */
X			"it",			/* italic */
X			"sf", 			/* sans serif */
X			"tt"			/* typewriter */
X		};
X#define MAXFONT 5
X
X/* The selection of font names may be site dependent.
X * Not all fonts are preloaded at all sizes.
X */
X
Xstatic char		*fontsizes[] = {
X			"elv", "elv",		/* default */
X			"fiv", "fiv", "fiv", "fiv", 	/* small fonts */
X			"fiv",			/* five point font */
X			"six", "sev", "egt",	/* etc */
X			"nin", "ten", "elv",
X			"twl", "twl", "frtn",	
X			"frtn", "frtn", "svtn",
X			"svtn", "svtn", "twty",
X			"twty", "twty", "twty", "twty", "twfv"
X			};
X#define MAXFONTSIZE 25
X
X#define TEXFONT(F)	(fontnames[((F) <= MAXFONT) ? (F)+1 : MAXFONT])
X#define TEXFONTSIZE(S)	(fontsizes[((S) <= MAXFONTSIZE) ? (S)+1 : MAXFONTSIZE])
END_OF_FILE
if test 815 -ne `wc -c <'transfig/fig2dev/dev/texfonts.h'`; then
    echo shar: \"'transfig/fig2dev/dev/texfonts.h'\" unpacked with wrong size!
fi
# end of 'transfig/fig2dev/dev/texfonts.h'
fi
if test -f 'transfig/fig2dev/drivers.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'transfig/fig2dev/drivers.h'\"
else
echo shar: Extracting \"'transfig/fig2dev/drivers.h'\" \(549 characters\)
sed "s/^X//" >'transfig/fig2dev/drivers.h' <<'END_OF_FILE'
Xextern struct driver dev_box;
Xextern struct driver dev_epic;
Xextern struct driver dev_latex;
Xextern struct driver dev_pic;
Xextern struct driver dev_pictex;
Xextern struct driver dev_ps;
X
Xstruct 
X	{char *name; struct driver *dev;}
X	drivers[]
X	= {
X		{"box",		&dev_box}, 
X#ifdef EPIC
X		{"epic",	&dev_epic},
X		{"eepic",	&dev_epic},
X		{"eepicemu",	&dev_epic},
X#endif
X#ifdef LATEX
X		{"latex",	&dev_latex},
X#endif
X#ifdef PIC
X		{"pic",		&dev_pic},
X#endif
X#ifdef PICTEX
X		{"pictex",	&dev_pictex},
X#endif
X#ifdef PS
X		{"ps",		&dev_ps},
X#endif
X		{"",		NULL}
X	};
END_OF_FILE
if test 549 -ne `wc -c <'transfig/fig2dev/drivers.h'`; then
    echo shar: \"'transfig/fig2dev/drivers.h'\" unpacked with wrong size!
fi
# end of 'transfig/fig2dev/drivers.h'
fi
if test -f 'transfig/fig2dev/fig2dev.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'transfig/fig2dev/fig2dev.h'\"
else
echo shar: Extracting \"'transfig/fig2dev/fig2dev.h'\" \(727 characters\)
sed "s/^X//" >'transfig/fig2dev/fig2dev.h' <<'END_OF_FILE'
X/* 
X * Device driver interface structure
X */
Xstruct driver {
X 	void (*option)();	/* interpret driver-specific options */
X  	void (*start)();	/* output file header */
X	void (*arc)();		/* object generators */
X	void (*ellipse)();
X	void (*line)();
X	void (*spline)();
X	void (*text)();
X	void (*end)();		/* output file trailer */
X  	int text_include;	/* include text length in bounding box */
X#define INCLUDE_TEXT 1
X#define EXCLUDE_TEXT 0
X};
X
Xextern char *strchr();
Xextern void fprintf(), fputc();
X
Xextern char Err_badarg[];
Xextern char Err_incomp[];
Xextern char Err_mem[];
X
Xextern char	*prog, *from;
Xextern int	font_size;
Xextern double	mag;
Xextern FILE	*tfp;
X
Xextern int llx, lly, urx, ury, coord_system;
X
Xextern void gendev_null();
END_OF_FILE
if test 727 -ne `wc -c <'transfig/fig2dev/fig2dev.h'`; then
    echo shar: \"'transfig/fig2dev/fig2dev.h'\" unpacked with wrong size!
fi
# end of 'transfig/fig2dev/fig2dev.h'
fi
if test -f 'transfig/fig2dev/fig2ps2tex' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'transfig/fig2dev/fig2ps2tex'\"
else
echo shar: Extracting \"'transfig/fig2dev/fig2ps2tex'\" \(456 characters\)
sed "s/^X//" >'transfig/fig2dev/fig2ps2tex' <<'END_OF_FILE'
X#! /bin/csh -f
X#
X# Fig2ps2tex - generate a TeX file for including a PostScript file
X#		 involves calculating the bounding box from fig2ps output
X#
Xset bbox = `grep "^%%BoundingBox:" $1`
X
Xset xsp = `echo "3k $bbox[4] $bbox[2] - 72 / p" | dc`
Xset ysp = `echo "3k $bbox[5] $bbox[3] - 72 / p" | dc`
X
Xecho "\makebox[${xsp}in][l]{"
Xecho "  \vbox to ${ysp}in{"
Xecho "    \vfill"
Xecho "    \special{psfile=$1}"
Xecho "  }"
Xecho "  \vspace{-\baselineskip}"
Xecho "}"
END_OF_FILE
if test 456 -ne `wc -c <'transfig/fig2dev/fig2ps2tex'`; then
    echo shar: \"'transfig/fig2dev/fig2ps2tex'\" unpacked with wrong size!
fi
chmod +x 'transfig/fig2dev/fig2ps2tex'
# end of 'transfig/fig2dev/fig2ps2tex'
fi
if test -f 'transfig/fig2dev/free.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'transfig/fig2dev/free.c'\"
else
echo shar: Extracting \"'transfig/fig2dev/free.c'\" \(2189 characters\)
sed "s/^X//" >'transfig/fig2dev/free.c' <<'END_OF_FILE'
X#include <stdio.h>
X#include <math.h>
X#include "object.h"
X
Xfree_arc(list)
XF_arc	**list;
X{
X	F_arc	*a, *arc;
X
X	for (a = *list; a != NULL;) {
X	    arc = a;
X	    a = a->next;
X	    if (arc->for_arrow) free((char*)arc->for_arrow);
X	    if (arc->back_arrow) free((char*)arc->back_arrow);
X	    free((char*)arc);
X	    } 
X	*list = NULL;
X	}
X
Xfree_compound(list)
XF_compound	**list;
X{
X	F_compound	*c, *compound;
X
X	for (c = *list; c != NULL;) {
X	    compound = c;
X	    c = c->next;
X	    free_arc(&compound->arcs);
X	    free_compound(&compound->compounds);
X	    free_ellipse(&compound->ellipses);
X	    free_line(&compound->lines);
X	    free_spline(&compound->splines);
X	    free_text(&compound->texts);
X	    free((char*)compound);
X	    } 
X	*list = NULL;
X	}
X
Xfree_ellipse(list)
XF_ellipse	**list;
X{
X	F_ellipse	*e, *ellipse;
X
X	for (e = *list; e != NULL;) {
X	    ellipse = e;
X	    e = e->next;
X	    free((char*)ellipse);
X	    } 
X	*list = NULL;
X	}
X
Xfree_line(list)
XF_line	**list;
X{
X	F_line	*l, *line;
X
X	for (l = *list; l != NULL;) {
X	    line = l;
X	    l = l->next;
X	    free_linestorage(line);
X	    } 
X	*list = NULL;
X	}
X
Xfree_text(list)
XF_text	**list;
X{
X	F_text	*t, *text;
X
X	for (t = *list; t != NULL;) {
X	    text = t;
X	    t = t->next;
X	    cfree(text->cstring);
X	    free((char*)text);
X	    } 
X	*list = NULL;
X	}
X
Xfree_spline(list)
XF_spline	**list;
X{
X	F_spline	*s, *spline;
X
X	for (s = *list; s != NULL;) {
X	    spline = s;
X	    s = s->next;
X	    free_splinestorage(spline);
X	    }
X	*list = NULL;
X	}
X
Xfree_splinestorage(s)
XF_spline      *s;
X{
X        F_point		*p, *q;
X        F_control	*a, *b;
X
X        for (p = s->points; p != NULL; p = q) {
X            q = p->next;
X            free((char*)p);
X            }
X        for (a = s->controls; a != NULL; a = b) {
X            b = a->next;
X            free((char*)a);
X            }
X	if (s->for_arrow) free((char*)s->for_arrow);
X	if (s->back_arrow) free((char*)s->back_arrow);
X        free((char*)s);
X        }
X
Xfree_linestorage(l)
XF_line	*l;
X{
X	F_point	*p, *q;
X
X	for (p = l->points; p != NULL; p = q) {
X	    q = p->next;
X	    free((char*)p);
X	    }
X	if (l->for_arrow) free((char*)l->for_arrow);
X	if (l->back_arrow) free((char*)l->back_arrow);
X	free((char*)l);
X	}
END_OF_FILE
if test 2189 -ne `wc -c <'transfig/fig2dev/free.c'`; then
    echo shar: \"'transfig/fig2dev/free.c'\" unpacked with wrong size!
fi
# end of 'transfig/fig2dev/free.c'
fi
if test -f 'transfig/fig2dev/getopt.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'transfig/fig2dev/getopt.c'\"
else
echo shar: Extracting \"'transfig/fig2dev/getopt.c'\" \(2996 characters\)
sed "s/^X//" >'transfig/fig2dev/getopt.c' <<'END_OF_FILE'
X/*
X	I got this off net.sources from Henry Spencer.
X	It is a public domain getopt(3) like in System V.
X	I have made the following modifications:
X
X	index(s,c) was added because too many people could
X	not compile getopt without it.
X
X	A test main program was added, ifdeffed by GETOPT.
X	This main program is a public domain implementation
X	of the getopt(1) program like in System V.  The getopt
X	program can be used to standardize shell option handling.
X		e.g.  cc -DGETOPT getopt.c -o getopt
X*/
X#include <stdio.h>
X
X#ifndef lint
Xstatic	char	sccsfid[] = "@(#) getopt.c 5.0 (UTZoo) 1985";
X#endif
X
X#define	ARGCH    (int)':'
X#define BADCH	 (int)'?'
X#define EMSG	 ""
X#define	ENDARGS  "--"
X
X/* this is included because index is not on some UNIX systems */
Xstatic
Xchar *
Xindex (s, c)
Xregister	char	*s;
Xregister	int 	c;
X	{
X	while (*s)
X		if (c == *s) return (s);
X		else s++;
X	return (NULL);
X	}
X
X/*
X * get option letter from argument vector
X */
Xint	opterr = 1,		/* useless, never set or used */
X	optind = 1,		/* index into parent argv vector */
X	optopt;			/* character checked for validity */
Xchar	*optarg;		/* argument associated with option */
X
X#define tell(s)	fputs(*nargv,stderr);fputs(s,stderr); \
X		fputc(optopt,stderr);fputc('\n',stderr);return(BADCH);
X
X
Xgetopt(nargc,nargv,ostr)
Xint	nargc;
Xchar	**nargv,
X	*ostr;
X{
X	static char	*place = EMSG;	/* option letter processing */
X	register char	*oli;		/* option letter list index */
X	char	*index();
X
X	if(!*place) {			/* update scanning pointer */
X		if(optind >= nargc || *(place = nargv[optind]) != '-' || !*++place) return(EOF);
X		if (*place == '-') {	/* found "--" */
X			++optind;
X			return(EOF);
X		}
X	}				/* option letter okay? */
X	if ((optopt = (int)*place++) == ARGCH || !(oli = index(ostr,optopt))) {
X		if(!*place) ++optind;
X		tell(": illegal option -- ");
X	}
X	if (*++oli != ARGCH) {		/* don't need argument */
X		optarg = NULL;
X		if (!*place) ++optind;
X	}
X	else {				/* need an argument */
X		if (*place) optarg = place;	/* no white space */
X		else if (nargc <= ++optind) {	/* no arg */
X			place = EMSG;
X			tell(": option requires an argument -- ");
X		}
X	 	else optarg = nargv[optind];	/* white space */
X		place = EMSG;
X		++optind;
X	}
X	return(optopt);			/* dump back option letter */
X}
X
X
X#ifdef GETOPT
X
X#ifndef lint
Xstatic	char	sccspid[] = "@(#) getopt.c 5.1 (WangInst) 6/15/85";
X#endif
X
Xmain (argc, argv) char **argv;
X	{
X	char	*optstring = argv[1];
X	char	*argv0 = argv[0];
X	extern	int 	optind;
X	extern	char	*optarg;
X	int 	opterr = 0;
X	int 	C;
X	char	*opi;
X	if (argc == 1)
X		{
X		fprintf (stderr, "Usage: %s optstring args\n", argv0);
X		exit (1);
X		}
X	argv++;
X	argc--;
X	argv[0] = argv0;
X	while ((C = getopt (argc, argv, optstring)) != EOF)
X		{
X		if (C == BADCH) opterr++;
X		printf ("-%c ", C);
X		opi = index (optstring, C);
X		if (opi && opi[1] == ARGCH)
X			if (optarg)
X				printf ("\"%s\" ", optarg);
X			else opterr++;
X		}
X	printf ("%s", ENDARGS);
X	while (optind < argc)
X		printf (" \"%s\"", argv[optind++]);
X	putchar ('\n');
X	exit (opterr);
X	}
X
X#endif
END_OF_FILE
if test 2996 -ne `wc -c <'transfig/fig2dev/getopt.c'`; then
    echo shar: \"'transfig/fig2dev/getopt.c'\" unpacked with wrong size!
fi
# end of 'transfig/fig2dev/getopt.c'
fi
if test -f 'transfig/fig2dev/newfont.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'transfig/fig2dev/newfont.h'\"
else
echo shar: Extracting \"'transfig/fig2dev/newfont.h'\" \(2809 characters\)
sed "s/^X//" >'transfig/fig2dev/newfont.h' <<'END_OF_FILE'
XReceived: from cu-arpa.cs.cornell.edu by loki.cs.cornell.edu (4.0/I-1.91f)
X	id AA13388; Fri, 21 Jul 89 12:48:10 EDT
XReceived: from thumper.bellcore.com by cu-arpa.cs.cornell.edu (5.61+2/1.91d)
X	id AA02218; Fri, 21 Jul 89 12:48:00 -0400
XReceived: by thumper.bellcore.com (5.54/4.7)
X	id AA07930; Fri, 21 Jul 89 12:47:12 EDT
XReceived: by dino.bellcore.com (4.12/4.7)
X	id AA10363; Fri, 21 Jul 89 12:49:10 edt
XDate: Fri, 21 Jul 89 12:49:10 edt
XFrom: dana@thumper.bellcore.com (Dana A. Chee)
XMessage-Id: <8907211649.AA10363@dino.bellcore.com>
XTo: beck@cs.cornell.edu (Micah Beck)
XIn-Reply-To: <8907191419.AA10822@utgard.cs.cornell.edu>
XSubject: Hello, Dana?
XStatus: R
X
XBelieve it or not, I haven't dropped off the face of the earth.  Yes
XI'm still working on it when time permits, and below is my font
Xscheme (with all ifdefs removed).  As you see, there are three
Xcomponents to a font, the face (font), style, and size.  Hope this
Xhelps you out (and hopefully an alpha of this will be out soon).
X
XDana
X
X
Xtypedef         struct f_text {
X                        int                     type;
X#define                                 T_LEFT_JUSTIFIED        0
X#define                                 T_CENTER_JUSTIFIED      1
X#define                                 T_RIGHT_JUSTIFIED       2
X                        int                     font;
X#define                                 TIMES                   0
X#define                                 HELVETICA               4
X#define                                 COURIER                 8
X#define                                 NCENBOOK                12
X                        int                     size;   /* point size */
X                        int                     color;
X                        int                     depth;
X                        double                  angle;  /* in radian */
X                        int                     style;
X#define                                 ROMAN           0
X#define                                 ITALIC          1
X#define                                 OBLIQUE         1
X#define                                 BOLD            2
X#define                                 BOLD_ITALIC     3
X#define                                 BOLD_OBLIQUE    3
X                        int                     height; /* pixels */
X                        int                     length; /* pixels */
X                        int                     base_x;
X                        int                     base_y;
X                        struct f_pen            *pen;
X                        char                    *cstring;
X#ifdef  X11
X                        GC                      gc;
X#endif  /* X11 */
X                        struct f_text           *next;
X                        }
X                F_text;
END_OF_FILE
if test 2809 -ne `wc -c <'transfig/fig2dev/newfont.h'`; then
    echo shar: \"'transfig/fig2dev/newfont.h'\" unpacked with wrong size!
fi
# end of 'transfig/fig2dev/newfont.h'
fi
if test -f 'transfig/fig2dev/pi.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'transfig/fig2dev/pi.h'\"
else
echo shar: Extracting \"'transfig/fig2dev/pi.h'\" \(94 characters\)
sed "s/^X//" >'transfig/fig2dev/pi.h' <<'END_OF_FILE'
X#ifndef M_PI
X#define M_PI	3.14159265358979323846
X#define M_PI_2	1.57079632679489661923
X#endif
END_OF_FILE
if test 94 -ne `wc -c <'transfig/fig2dev/pi.h'`; then
    echo shar: \"'transfig/fig2dev/pi.h'\" unpacked with wrong size!
fi
# end of 'transfig/fig2dev/pi.h'
fi
if test -f 'transfig/fig2dev/pic2tpic' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'transfig/fig2dev/pic2tpic'\"
else
echo shar: Extracting \"'transfig/fig2dev/pic2tpic'\" \(1034 characters\)
sed "s/^X//" >'transfig/fig2dev/pic2tpic' <<'END_OF_FILE'
X#!/bin/sh
Xsed -e '
X	s/\(\\f[^(]\)\(\\s[0-9]*\)/\2\1/g
X	s/\(\\f(..\)\(\\s[0-9]*\)/\2\1/g
X	s/"\([^"]*\)\\fP\([^"]*\)"/"\1\2"/g
X	s/"\([^"]*\)\\fR\([^"]*\)"/"\1\\rm \2"/g
X	s/"\([^"]*\)\\fI\([^"]*\)"/"\1\\it \2"/g
X	s/"\([^"]*\)\\fB\([^"]*\)"/"\1\\bf \2"/g
X	s/"\([^"]*\)\\fH\([^"]*\)"/"\1\\ss \2"/g
X	s/"\([^"]*\)\\fC\([^"]*\)"/"\1\\tt \2"/g
X	s/"\([^"]*\)\\f(CO\([^"]*\)"/"\1\\tt \2"/g
X	s/"\([^"]*\)\\f(CW\([^"]*\)"/"\1\\tt \2"/g
X	s/"\([^"]*\)\\s0\([^"]*\)"/"\1\2"/g
X	s/"\([^"]*\)\\s[56]\([^0-9][^"]*\)"/"\1\\tiny \2"/g
X	s/"\([^"]*\)\\s7\([^0-9][^"]*\)"/"\1\\scriptsize \2"/g
X	s/"\([^"]*\)\\s8\([^0-9][^"]*\)"/"\1\\footnotesize \2"/g
X	s/"\([^"]*\)\\s9\([^0-9][^"]*\)"/"\1\\small \2"/g
X	s/"\([^"]*\)\\s1[01]\([^"]*\)"/"\1\\normalsize \2"/g
X	s/"\([^"]*\)\\s1[23]\([^"]*\)"/"\1\\large \2"/g
X	s/"\([^"]*\)\\s1[4-6]\([^"]*\)"/"\1\\Large \2"/g
X	s/"\([^"]*\)\\s1[7-9]\([^"]*\)"/"\1\\LARGE \2"/g
X	s/"\([^"]*\)\\s2[0-3]\([^"]*\)"/"\1\\huge \2"/g
X	s/"\([^"]*\)\\s2[4-9]\([^"]*\)"/"\1\\Huge \2"/g
X	s/"\([^"]*\)\\s3[0-9]\([^"]*\)"/"\1\\Huge \2"/g
X	' $*
END_OF_FILE
if test 1034 -ne `wc -c <'transfig/fig2dev/pic2tpic'`; then
    echo shar: \"'transfig/fig2dev/pic2tpic'\" unpacked with wrong size!
fi
# end of 'transfig/fig2dev/pic2tpic'
fi
if test -f 'transfig/patchlevel.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'transfig/patchlevel.h'\"
else
echo shar: Extracting \"'transfig/patchlevel.h'\" \(21 characters\)
sed "s/^X//" >'transfig/patchlevel.h' <<'END_OF_FILE'
X#define PATCHLEVEL 1
END_OF_FILE
if test 21 -ne `wc -c <'transfig/patchlevel.h'`; then
    echo shar: \"'transfig/patchlevel.h'\" unpacked with wrong size!
fi
# end of 'transfig/patchlevel.h'
fi
if test ! -d 'transfig/transfig' ; then
    echo shar: Creating directory \"'transfig/transfig'\"
    mkdir 'transfig/transfig'
fi
if test -f 'transfig/transfig/Makefile' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'transfig/transfig/Makefile'\"
else
echo shar: Extracting \"'transfig/transfig/Makefile'\" \(358 characters\)
sed "s/^X//" >'transfig/transfig/Makefile' <<'END_OF_FILE'
X#	TransFig : Fig code translation Makefile creation program
X#
X#	Micah Beck
X#
X
XOBJ = transfig.o txfile.o mkfile.o sys.o ../fig2dev/getopt.c
X
X#CFLAGS =  -g
XCFLAGS = -O
X
XTARGET = transfig$(TARGET_ARCH)
X
X$(TARGET): $(OBJ)
X	$(CC) $(TARGET_ARCH) $(OBJ) -lm -o $(TARGET)
X
X$(OBJ): transfig.h
X
X#########
Xtidy: 
X	rm -f *.o
X
Xclean: 
X	rm -f *.o transfig transfig-* core
END_OF_FILE
if test 358 -ne `wc -c <'transfig/transfig/Makefile'`; then
    echo shar: \"'transfig/transfig/Makefile'\" unpacked with wrong size!
fi
# end of 'transfig/transfig/Makefile'
fi
if test -f 'transfig/transfig/mkfile.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'transfig/transfig/mkfile.c'\"
else
echo shar: Extracting \"'transfig/transfig/mkfile.c'\" \(3510 characters\)
sed "s/^X//" >'transfig/transfig/mkfile.c' <<'END_OF_FILE'
X#include <stdio.h>
X#include "transfig.h"
X
X/*
X * create an appropriate makefile
X */
Xmakefile(mk, arg_list)
XFILE *mk;
Xargument *arg_list;
X{
X  argument *a;
X  char *i;
X  enum language to;
X  int needps, needpic, needfig;
X  
X
X  fprintf(mk, "#\n# TransFig makefile\n#\n");
X
X  fprintf(mk, "\nall: ");
X  for (a = arglist; a; a = a->next)
X    	fprintf(mk, "%s.tex ", a->name);
X  fprintf(mk, "\n");
X
X  for (a = arglist; a; a = a->next)
X  {
X	i = a->name;
X	to = a->tolang;
X
X	needps = needpic = needfig = 0;
X
X	fprintf(mk, "\n# translation into %s\n\n", lname[(int)to]);
X
X	switch (to)
X	{
X	case pictex:
X		putfig(mk, pictex, a->f, a->s, a->m, i, "tex");
X		needfig = 1;
X		break;
X
X	case postscript:
X                puttarget(mk, i, "tex", "ps");
X                fprintf(mk, "\tfig2ps2tex %s.ps >%s.tex\n", i, i);
X		needps = 1;
X                break;
X
X        case psfig:
X                puttarget(mk, i, "tex", "ps");
X                fprintf(mk,"\techo \'\\strut\\psfig\{figure=%s.ps\}\' >%s.tex\n",
X                          i, i);
X		needps = 1;
X                break;
X
X	case latex:
X		putfig(mk, latex, a->f, a->s, a->m, i, "tex");
X		needfig = 1;
X		break;
X
X	case eepicemu:
X	case epic:
X	case eepic:
X		putfig(mk, to, a->f, a->s, a->m, i, "tex");
X		needfig = 1;
X		break;
X
X	case tpic:
X		puttarget(mk, i, "tex", "pic");
X		/* fprintf(mk, "\ttpic %s.pic\n", i); */
X		fprintf(mk, "\tpic2tpic %s.pic | tpic > %s.tex\n", i, i);
X		fprintf(mk, "\techo \'\\strut\\box\\graph\' >>%s.tex\n", i);
X		needpic = 1;
X		break;
X
X	case box:
X		putfig(mk, box, NULL, NULL, a->m, i, "tex");
X		needfig = 1;
X		break;
X
X	}
X
X	putclean(mk, i, "tex" );
X
X	/* conversion to postscript */
X	if (needps && a->type != ps) {
X		if ( a->tops ) {
X		    puttarget(mk, i, "ps", iname[(int)a->type]);
X		    fprintf(mk, "\t%s %s.%s > %s.ps\n", a->tops, i, iname[(int)a->type], i);
X		}
X		else {
X                    putfig(mk, postscript, a->f, a->s, a->m, i, "ps");
X                    a->interm = mksuff(i, ".ps");
X		    needfig = 1;
X		}
X		putclean(mk, i, "ps" );
X	}
X
X	/* conversion to pic */
X	if (needpic && a->type != pic) {
X		if ( a->topic ) {
X		    puttarget(mk, i, "pic", iname[(int)a->type]);
X		    fprintf(mk, "\t%s %s.%s > %s.pic\n", a->topic, i, iname[(int)a->type],i);
X		}
X		else {
X		    putfig(mk, tpic, a->f, a->s, a->m, i, "pic");
X
X		    needfig = 1;
X		}
X		putclean(mk, i, "pic" );
X	}
X
X	/* conversion to fig */
X	if (needfig && a->type != fig) {
X		if ( a->tofig ) {
X		    puttarget(mk, i, "fig", iname[(int)a->type]);
X		    fprintf(mk, "\t%s %s.%s > %s.fig\n", a->tofig, i, iname[(int)a->type],i);
X		    a->interm = mksuff(i, ".fig");
X		}
X		else {
X		    fprintf(stderr, "transfig: warning: don't now how to make %s\n", mksuff(i, ".fig") );
X		}
X		putclean(mk, i, "fig" );
X	}
X  }
X}
X
Xputtarget(mk, i, suf1, suf2)
XFILE *mk;
Xchar *i, *suf1, *suf2;
X{
X    fprintf(mk, "%s.%s: %s.%s %s\n", i, suf1, i, suf2, mkfile);
X}
X
Xputfig(mk, to, f, s, m, i, suf)
XFILE *mk;
Xenum language to;
Xchar *f, *s, *m, *i, *suf;
X{
X  fprintf(mk, "%s%s%s: %s.fig %s\n",
X	       i, (suf ? "." : ""), (suf ? suf : ""), i, mkfile);
X
X  if ( to == tpic )
X	  fprintf(mk, "\tfig2dev -L pic ");
X  else
X	  fprintf(mk, "\tfig2dev -L %s ", lname[(int)to]);
X
X  if (f && *f) fprintf(mk, "-f %s ", f);
X  if (s && *s) fprintf(mk, "-s %s ", s);
X  if (m && *m) fprintf(mk, "-m %s ", m);
X
X  fprintf(mk, "%s.fig > %s%s%s\n", i, i, (suf ? "." : ""), (suf ? suf : ""));
X}
X
Xputclean(mk, i, suf)
XFILE *mk;
Xchar *i, *suf;
X{
X   fprintf(mk, "clean::\n");
X   fprintf(mk, "\trm -f %s.%s\n", i, suf);
X   fprintf(mk, "\n");
X}
END_OF_FILE
if test 3510 -ne `wc -c <'transfig/transfig/mkfile.c'`; then
    echo shar: \"'transfig/transfig/mkfile.c'\" unpacked with wrong size!
fi
# end of 'transfig/transfig/mkfile.c'
fi
if test -f 'transfig/transfig/sys.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'transfig/transfig/sys.c'\"
else
echo shar: Extracting \"'transfig/transfig/sys.c'\" \(857 characters\)
sed "s/^X//" >'transfig/transfig/sys.c' <<'END_OF_FILE'
X#include <stdio.h>
X#include "transfig.h"
X
X#define MAXSYS 1000
Xstatic char sysbuf[MAXSYS];
X
Xchar *sysls()
X{
X  FILE *ls;
X  int i;
X  char c;
X
X  ls = popen("/bin/ls *.fig", "r");
X  i = 0;
X  c = fgetc(ls);
X  while (c != EOF & i < MAXSYS-1)
X  {
X	sysbuf[i] = c;
X	i += 1;
X	c = fgetc(ls);
X  }
X  sysbuf[i] = NULL;
X  return sysbuf;
X}
X
Xsysmv(f)
Xchar *f;
X{
X  sprintf(sysbuf, "%s~", f);
X  unlink(sysbuf);
X  if (!link(f, sysbuf)) unlink(f);
X}
X
Xchar *strip(str, suf)
Xchar *str, *suf;
X{
X  char *p1, *p2;
X
X  for (p1 = &str[strlen(str)-1], p2 = &suf[strlen(suf)-1];
X	(p1 >= str && p2 >= suf) && (*p1 == *p2);
X	--p1, --p2);
X
X  if (p2 < suf)
X  {
X	*(p1+1) = NULL;
X	return str;
X  } else
X	return NULL;
X}
X
Xchar *mksuff(name, suff)
Xchar *name, *suff;
X{
X  char *temp;
X
X  temp = (char *)malloc(strlen(name)+strlen(suff)+1);
X  strcpy(temp, name);
X  strcat(temp, suff);
X  return temp;
X}
END_OF_FILE
if test 857 -ne `wc -c <'transfig/transfig/sys.c'`; then
    echo shar: \"'transfig/transfig/sys.c'\" unpacked with wrong size!
fi
# end of 'transfig/transfig/sys.c'
fi
if test -f 'transfig/transfig/transfig.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'transfig/transfig/transfig.c'\"
else
echo shar: Extracting \"'transfig/transfig/transfig.c'\" \(3354 characters\)
sed "s/^X//" >'transfig/transfig/transfig.c' <<'END_OF_FILE'
X/*
X * transfig: 	figure translation setup program
X *		creates TeX macro file and makefile
X *
X * usage: transfig <option> ... [[<flag> ... ] [<figure>] ... ] ...
X *
X * where:	<option> = -L <language> | -M <makefile> | -T <texfile>
X *		<flag>	 = -f <font> | -s <size> | -m <scale>
X */
X
X#include <stdio.h>
X#include <string.h>
X#include "transfig.h"
X
Xargument *parse_arg(), *arglist = NULL, *lastarg = NULL;
Xchar *strip();
X
Xchar *mkfile = "Makefile";
Xchar *txfile = "transfig.tex";
X
Xchar *lname[] = {
X	"box",
X	"pictex",
X	"latex",
X	"epic",
X	"eepic",
X	"eepicemu",
X	"ps",
X	"psfig",
X	"tpic"};
X
Xchar *iname[] = {
X	"fig",
X  	"pic",
X	"x",
X	"ps"};
X 
Xmain(argc, argv)
Xint argc;
Xchar *argv[];
X{
X  FILE *mk, *tx;
X  enum language tolang = epic;
X  argument *a;
X  char c, *cp, *arg_f = NULL, *arg_s = NULL, *arg_m = NULL, *argbuf;
X
X  for ( optind = 1; optind < argc; optind++ ) {
X    cp = argv[optind];
X    if (*cp == '-')
X    {
X  	if (!cp[1])
X	{
X		fprintf(stderr, "transfig: bad option format '-'\n");
X		exit(1);
X	}
X	if (cp[2])
X	{
X		optarg = &cp[2];
X	} else
X	{
X		optind += 1;
X		if (optind == argc)
X		{
X			fprintf(stderr,
X				"transfig: no value for '%c' arg\n", cp[1]);
X			exit(1);
X		}
X		optarg = argv[optind];
X	}
X 	switch (cp[1]) {
X 
X  	case 'L':
X		tolang = str2lang(optarg);
X		break;
X  	case 'M':
X		mkfile = optarg;
X		break;
X  	case 'T':
X		txfile = optarg;
X		break;
X	case 'f':
X		arg_f = optarg;
X		break;
X	case 's':
X		arg_s = optarg;	
X		break;
X	case 'm':
X		arg_m = optarg;	
X		break;
X
X  	default:
X		fprintf(stderr, "transfig: illegal option -- '%c'\n", *cp);
X		exit(1);
X  	}
X    } else
X    {
X	a = parse_arg(tolang, arg_f, arg_s, arg_m, argv[optind]);
X
X	if ( !lastarg )
X		arglist = a;
X	else
X		lastarg->next = a; 
X	lastarg = a;
X    }
X  }
X
X  /* no files specified -> all files */
X  if (!arglist)
X  {
X	argbuf = sysls();
X	while (cp = strchr(argbuf, '\n'))
X	{
X		*cp = '\0';
X		a = parse_arg(tolang, arg_f, arg_s, arg_m, argbuf);
X		if ( !lastarg )
X			arglist = a;
X		else
X			lastarg->next = a; 
X		lastarg = a;
X		argbuf = cp+1;
X	}
X  }
X
X  sysmv(mkfile);
X  tx = fopen(txfile, "w");
X  texfile(tx, arglist);
X
X  mk = fopen(mkfile, "w");
X  makefile(mk, arglist);
X}
X
Xenum language str2lang(s)
Xchar *s;
X{
X  int i;
X
X  /* aliases */
X  if (!strcmp(s, "pic")) return tpic;
X  if (!strcmp(s, "postscript")) return postscript;
X  if (!strcmp(s, "null")) return box;
X
X  /* real names*/
X  for (i = 0; i <= (int)MAXLANG; i++)
X	if (!strcmp(lname[i], s)) return (enum language)i;
X
X  /* other strings */
X  fprintf(stderr, "Unknown output language \"%s\"\n", s);
X  exit(1);
X}
X
Xargument *parse_arg(tolang, arg_f, arg_s, arg_m, arg)
Xenum language tolang;
Xchar *arg_f, *arg_s, *arg_m, *arg;
X{
X  argument *a;
X
X  a = (argument *)malloc(sizeof(argument));
X  a->f = arg_f;
X  a->s = arg_s;
X  a->m = arg_m;
X  a->next = NULL;
X  a->tofig = NULL;
X  a->topic = NULL;
X  a->tops = NULL;
X  a->tolang = tolang;
X  
X  /* PIC */
X  if (strip(arg, ".pic"))
X  {
X  	a->name = mksuff(arg, "");
X  	a->type = pic;
X	a->tofig = PIC2FIG;
X	return a;
X  }
X
X  /* Xpic format */
X  if (strip(arg, ".x"))
X  {
X  	a->name = mksuff(arg, "");
X  	a->type = xpic;
X	a->tofig = X2FIG;
X	a->topic = X2PIC;
X	a->tops = X2PS;
X 	return a;
X  }
X
X  /* PS format */
X  if (strip(arg, ".ps"))
X  {
X  	a->name = mksuff(arg, "");
X  	a->type = ps;
X 	return a;
X  }
X
X  /* Fig format */
X  strip(arg, ".fig");
X  a->name = mksuff(arg, "");
X  a->type = fig;
X  return a;
X}
END_OF_FILE
if test 3354 -ne `wc -c <'transfig/transfig/transfig.c'`; then
    echo shar: \"'transfig/transfig/transfig.c'\" unpacked with wrong size!
fi
# end of 'transfig/transfig/transfig.c'
fi
if test -f 'transfig/transfig/transfig.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'transfig/transfig/transfig.h'\"
else
echo shar: Extracting \"'transfig/transfig/transfig.h'\" \(767 characters\)
sed "s/^X//" >'transfig/transfig/transfig.h' <<'END_OF_FILE'
X/*
X * converters program names
X */
X#define FIG2DEV	"fig2dev"
X#define PIC2FIG "pic2fig"
X#define X2FIG "x2fig"
X#define X2PIC "x2pic"
X#define X2PS "x2ps -x"
X
X/*
X * filename defaults
X */
X#define MK "Makefile"
X#define TX "transfig.tex"
X
Xenum language  {box, pictex, 
X	latex, epic, eepic, eepicemu,
X	postscript, psfig, tpic};
X#define MAXLANG tpic
X
Xenum input {fig, pic, xpic, ps};
X#define MAXINPUT xps
X
Xtypedef struct argument{
X	char *name, *interm, *f, *s, *m, *tofig, *topic, *tops;
X	enum language tolang;
X	enum input type;
X	struct argument *next;
X} argument ;
X
Xextern enum language str2lang();
Xextern char *lname[];
Xextern char *iname[];
X
Xextern char *sysls(), *mksuff();
Xextern argument *arglist;
Xextern char *txfile, *mkfile;
X
Xextern char *optarg;
Xextern int optind;
X
END_OF_FILE
if test 767 -ne `wc -c <'transfig/transfig/transfig.h'`; then
    echo shar: \"'transfig/transfig/transfig.h'\" unpacked with wrong size!
fi
# end of 'transfig/transfig/transfig.h'
fi
if test -f 'transfig/transfig/txfile.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'transfig/transfig/txfile.c'\"
else
echo shar: Extracting \"'transfig/transfig/txfile.c'\" \(1497 characters\)
sed "s/^X//" >'transfig/transfig/txfile.c' <<'END_OF_FILE'
X#include <stdio.h>
X#include "transfig.h"
X
X/*
X * create appropriate .tex file
X */
Xtexfile(tx, arg_list)
XFILE *tx;
Xargument *arg_list;
X{
X  enum language to;
X  argument *a, *arg_l;
X
X  for (a = arglist; a; a = a->next) {
X     to = a->tolang;
X
X     /* see if we already have this language */
X     for (arg_l = arglist; arg_l != a; arg_l = arg_l->next)
X	if ( arg_l->tolang == to ) break;
X	
X     if ( arg_l == a )
X	switch (to)
X	{
X	case pictex:
X		fprintf(tx, "\\typeout{TransFig: figures in PiCTeX.}\n");
X		fprintf(tx, "\\input{prepictex}\n");
X		fprintf(tx, "\\input{pictex}\n");
X		fprintf(tx, "\\input{postpictex}\n");
X		break;
X
X	case postscript:
X		fprintf(tx, "\\typeout{TransFig: figures in PostScript.}\n");
X		break;
X
X	case psfig:
X		fprintf(tx, "\\typeout{TransFig: figures in PostScript w/psfig.}\n");
X		fprintf(tx, "\\input{psfig}\n");
X		break;
X
X	case latex:
X		fprintf(tx, "\\typeout{TransFig: figures in LaTeX.}\n");
X		break;
X
X	case eepicemu:
X		to = eepicemu;
X
X	case eepic:
X#ifdef eemulation
X		to = eepicemu;
X#endif
X
X	case epic:
X		fprintf(tx, "\\typeout{TransFig: figures in %s.}\n", lname[(int)to]);
X		if (to == eepicemu || to == eepic)
X			fprintf(tx, "\\input{epic.sty}");
X		fprintf(tx, "\\input{%s.sty}\n", lname[(int)to]);
X		break;
X
X	case tpic:
X		fprintf(tx, "\\typeout{TransFig: figures in tpic.}\n");
X		break;
X
X	case box:
X		fprintf(tx, "\\typeout{TransFig: null figures.}\n");
X		break;
X
X	default:
X		fprintf(tx, "Unknown graphics language %s\n", lname[(int)to]);
X		exit(1);
X		break;
X
X	}
X  }
X}
END_OF_FILE
if test 1497 -ne `wc -c <'transfig/transfig/txfile.c'`; then
    echo shar: \"'transfig/transfig/txfile.c'\" unpacked with wrong size!
fi
# end of 'transfig/transfig/txfile.c'
fi
echo shar: End of archive 1 \(of 6\).
cp /dev/null ark1isdone
MISSING=""
for I in 1 2 3 4 5 6 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 6 archives.
    rm -f ark[1-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0
-- 
Please send comp.sources.unix-related mail to rsalz@uunet.uu.net.
Use a domain-based address or give alternate paths, or you may lose out.