DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T m

⟦b2635b5d2⟧ TextFile

    Length: 10847 (0x2a5f)
    Types: TextFile
    Names: »manual.tex«

Derivation

└─⟦060c9c824⟧ Bits:30007080 DKUUG TeX 2/12/89
    └─⟦this⟧ »./tex82/TeXgraphics/transfig/doc/manual/manual.tex« 

TextFile

% Master File: manual.tex
% Document Type: LaTeX
%
\input{setup12.tex}
\input{transfig}
%
%\lfoot{\small\it \today}
%\cfoot{\small\fbox{DRAFT}}
\lfoot{\it February 18, 1988}
\cfoot{}
\rfoot{\small\rm page\ \thepage}
%
\newcommand{\PicTeX}{{PiC\TeX}}
\newcommand{\PS}{{\sc PS}}
\newcommand{\DVI}{{\sc DVI}}
\newcommand{\PIC}{{\sc PIC}}
%
\begin{document}
\begin{center}

\Large \bf	TransFig: Portable Figures for \TeX\ \\[0.2in]

\large\it	Micah Beck \\

\rm		Department of Computer Science \\
		Cornell University \\
		Ithaca, New York  14853 \\[0.2in]
\end{center}

TransFig is a mechanism for integrating simple figures into \TeX\ documents.
Several ``graphics languages'' exist which achieve such integration, but none
	is widely enough used to be called a standard.
TransFig's goal is to maintain the portability of \TeX\ documents across
	printers and operating environments.
The central mechanism in TransFig is Fig code, a simple graphics description
	format which is produced by the Fig interactive graphics editor.
Transfig provides an automatic and uniform way to
	{\it Trans}\,late {\it Fig} code into various graphics languages and
	to integrate that code into a \TeX\ document.

\section{TransFig}
The Transfig package includes several translators between Fig code and
	other graphics languages (see figure \ref{f:intro-trans}).
The programs shown in dashed boxes were not developed as part
	of the Transfig distribution, but are compatible with it.
These translators can be used directly to produce various graphics languages
	from Fig code, but do not in themselves provide document portability.
Each graphics language requires different macro files to be loaded, or
	has a different command for specifying that a figure be included
	in the document.

Transfig allows these differences to be hidden behind a uniform \TeX\
	interface.
If this interface is followed, then the makefile created by the {\tt transfig}
	command will translate Fig code into any of these graphics languages
	without changing to the \TeX\ document.
To change to a different graphics language, it is necessary only to rerun
	{\tt transfig}, and then {\tt make}.
Make can also be used to keep the translated code up to date when
	figures change.

The graphics in this manual were created using Fig and integrated into the
	document using TransFig.

\begin{figure}
	\hrule
	\vspace{2pt}
	\begin{center}
		\input{trans}
	\end{center}
	\hrule
	\caption{Fig Code Translations}
	\label{f:intro-trans}
\end{figure}
\vspace{2pt}

\subsection{Files Name Conventions}

Say that a document is to include a set of figures which are stored in Fig
	code form.
These should be in files with the name suffix {\tt .fig}, for instance
	{\tt figure1.fig, figure2.fig,\ldots figuren.fig}.
TransFig will create files {\tt figure1.tex, figure2.tex,\ldots figuren.tex}
	for {\verb|\input|} to the \TeX\ document,
	and in some cases will create files with other suffixes.
Additionally, TransFig creates a file named {\tt transfig.tex} which
	must be {\verb|\input|} at the start of the document.

\subsection{Transfig \TeX\ Documents}

\begin{figure}
	\hrule
	\vspace{2pt}
	\small
	\begin{center}
		\[ \begin{array}{lr}
%
			\verb|\documentstyle{article}|	& \\
			\verb|\input{transfig}|		&
					 ~~~\mbox{TransFig macro file}\\
			\verb|\begin{document}|		& \\
			\hfill \vdots \hfill		& \\
%
			\verb|\begin{figure}|		& \\
			~~~\verb|\begin{center}|	& \\
			~~~\verb|\input{figurei}|	&
					\mbox{i'th  TransFig figure}\\
%
			~~~\verb|  \end{center}|		& \\
			\verb|\end{figure}|		& \\
			\hfill \vdots \hfill		& \\
%
		\end{array} \]
	\end{center}
	\hrule
	\caption{Layout of a TransFig \TeX\ Document}
	\label{f:tex-format}
\end{figure}
\vspace{2pt}

In order to use TransFig, a \TeX\ file must follow the format shown in
	figure \ref{f:tex-format}.
The document must input the file {\tt transfig.tex} before any
	TransFig figure is encountered.
At the point where the $i$th figure {\tt figurei} is to be inserted,
	the file {\tt figurei.tex} is input.

\subsection{Using TransFig}

The transfig command has the form
%
\begin{center}
	{\tt transfig} {\it language filename} [\ldots]
\end{center}
%
where {\it language} is one of the following:
%
\begin{quote}
\begin{description}
\item[pictex]
	for translation to \PicTeX\ macros.
\item[postscript]
	for translation to PostScript.
\end{description}

See section~\ref{s:languages} for further details about these languages.
\end{quote}

Each file name specifies a Fig file, either with or without the {\tt .fig}
	suffix.
Fig creates a file called {\tt Makefile} to apply the appropriate translator
	to the named files, and creates an appropriate {\tt transfig.tex} file.
Thus, to create a {\tt Makefile} which will translate all figures in a
	directory to \PicTeX, the command would be
%
\begin{center}
	{\tt transfig pictex *.fig}
\end{center}

After running {\tt transfig}, simply type ``{\tt make}'' to create the 
	appropriate \TeX\ files.
{\tt Make} should be rerun whenever a Fig file is changed to recreate
	the corresponding \TeX\ file.
To change between graphics languages, simply type ``{\tt make clean}'' to
	remove the files created by {\tt transfig}, and then rerun
	{\tt transfig}.

\subsection{Text in Figures and Portability}
\label{s:portability}

In order to be translatable into different graphics languages, Fig code
	used in TransFig documents should use only those features which
	are supported by all of them.
In particular, some graphics languages support more sophisticated processing
	of text which is part of the figure than others.
\PicTeX, for example, allows full use of \TeX\ macros in text strings,
	while PostScript uses only built-in fonts.,

The standard way to use text in TransFig figures is to use only
	straight text with no \TeX\ commands.
The text font is determined by the translator or the graphics language.
A document which makes use of \TeX\ commands in text can still be created as a
	TransFig document, but it will not be portable

Similarly, some graphics languages have controlling commands which are
	not understood by all (such as Pic\TeX's {\verb|\nopictures|}).
To create a portable TransFig document, these commands should not be used.
However, if portability is not an issue (as when developing a document),
	then they can be used at any point after the
	{\verb|\input{transfig}|} command.

\section{Graphics Languages and Fig Translators}
\label{s:languages}

Transfig currently supports two graphics languages: \PicTeX, PostScript.
The Fig translation programs corresponding to these languages are
	{\tt fig2tex} and {\tt fig2ps}.
Each language may be appropriate in different operating environments
	or for different applications.
It is hoped that more translators will be developed to support other
	graphics languages.
A short description of the available languages is given below:
\begin{quote}
\begin{description}
\item[\PicTeX]
	consists of a set of \TeX\ macros which implements simple
		graphics objects directly in \TeX.
	\PicTeX\ makes no use of pre- or post-processors; the \DVI\ files it
		generates are completely standard, and can be printed or
		previewed in any environment where \TeX\ is used.
	This result is achieved by using \TeX\ integer arithmetic to
		do all plotting calculations, and drawing the figure
		using the period character as a ``brush''.
	As a result \PicTeX\ is quite slow and requires a large internal
		\TeX\ memory.

\item[PostScript]
	(\PS)\, is a powerful graphics language which is gaining
		acceptance as a standard.
	In an environment where \DVI\ code is translated into \PS\ before
		being printed, it is usually possible to insert a
		separately generated PostScript file into a 
		the document, using the \TeX\ {\verb|\special|} command.
	However, the resulting \PS\ file can be previewed only
		using a \PS\ previewer, and must be printed on a \PS\ printer,
		such as the Apple LaserWriter.

\end{description}
\end{quote}
%
When \TeX\ processes the file {\tt transfig.tex}, it will produce the
	message ``{\verb|Transfig: figures in |}{\it language}'' indicating
	which graphics language is in use.

\section{The \PIC\ to Fig Translator}
\label{s:pic2fig}

The \PIC-to-Fig translator allows graphics to be described in \PIC,
	the language of Brian Kernighan's graphics preprocessor for Troff.
The Fig code produced by {\tt pic2fig} is compatible with that produced by
	Fig, and can be edited with Fig.
This translator is included because Fig code itself does not have
	a syntax which is readable by humans, and is not well documented.
The {\tt pic2fig} program itself is in fact a modified form of the {\tt tpic}
	program, which was adapted from \PIC\ itself
	(see section~\ref{s:software}).

The overall goal of TransFig is to provide a single framework for graphics
	which can be included in TeX documents.
The motivation is to attract the builders of tools such as graphics editors
	 to produce output compatible with this framework.
An programs which produces \PIC\ can be translated into various graphics
	languages via {\tt pic2fig} and {\tt fig2*} translators.
Fig itself, and any other programs which actually produce Fig code
	can be translated more directly.

\appendix
\section{Related Software}
\label{s:software}

Software availability is subject to change, and this list may not be
	completely up to date.

\begin{description}

\item[Fig]
	is an interactive graphics editor in the style of MacDraw
	which runs under the Suntools/SunView windowing system.
It produces intermediate code which can be translated into
	a variety of graphics languages, including \PIC\ , Postscript,
	and \PicTeX.

Fig was developed by Supoj Sutanthavibul at the University of Texas at Austin,
	({\tt supoj@SALLY.UTEXAS.EDU}), and is available via anonymous
	{\tt FTP} from {\tt SALLY}.

\item[\PicTeX]
	is a set of macros for describing graphics in TeX documents.
	\PicTeX\ is unique among available graphics languages in that it
	is implemented entirely within standard \TeX, and requiring no
	pre- or post processing programs or special fonts.
The main problem in using \PicTeX is its slow operation (all calculations
	are done using \TeX's integer arithmetic) and large memory
	requirements.
Many \PicTeX\ users have turned to C implementations of \TeX\ in order to obtain
	memory sizes larger than are possible using the standard Web/Pascal
	version.

\PicTeX\ was developed by Michael Wichura at the University of
	Chicago ({\tt wichura@GALTON.UCHICAGO.EDU}), and is available via
	anonymous {\tt FTP} from {\tt A.CS.UIUC.EDU}.

\item[tpic]
	is a version of Brian Kernighan's \PIC\ graphics preprocessor
	for Troff.
Tpic has been altered to produce \TeX\ {\verb|\special|} commands which are
	understood by some \DVI\ print drivers and previewers.

\end{description}

%\section{Fig Code}
%\label{s:figcode}

\end{document}