Evidence for Unusual Dynamical Arrest Scenario in Short Ranged Colloidal Systems
Extracted source text ยท arXiv cond-mat/0201372
\documentstyle[aps,prl,multicol]{revtex}
%\documentstyle[preprint,aps,prl]{revtex}
\include{psfig}
\input epsf
\begin{document}
\author{G. Foffi$^1$, K.A. Dawson$^1$,
S.V. Buldyrev$^{2,3}$, F. Sciortino$^2$,
E. Zaccarelli$^2$, P. Tartaglia$^2$}
\address{$^1$ Irish Centre for Colloid Science
and Biomaterials, Department of Chemistry,\\ University College Dublin,
Belfield, Dublin 4, Ireland\\
$^2$ Dipartimento di Fisica, Istituto Nazionale di Fisica della Materia,
and INFM Center for Statistical Mechanics \\ and Complexity,
Universit\`{a} di Roma
La Sapienza, P.le A. Moro 5, I-00185 Rome, Italy\\
$^3$ Center for Polymer Studies and Department of Physics, Boston University,
Boston, MA 02215, USA.
}
\title{{\bf Evidence for Unusual Dynamical Arrest Scenario in
Short Ranged Colloidal Systems}
}
\date{\today}
\maketitle
\begin{abstract}
Extensive molecular dynamics simulation studies of
particles interacting via a short ranged
attractive square-well (SW) potential are reported.
The calculated loci of constant diffusion coefficient $D$
in the temperature-packing fraction
plane show a re-entrant behavior , i.e. an increase of diffusivity on
cooling, confirming an important part of the high
volume-fraction dynamical-arrest scenario earlier predicted by
theory for particles with short ranged potentials.
The more efficient localization
mechanism induced by the short range bonding provides, on average,
additional free volume as compared to the hard-sphere case and results
in faster dynamics.
\end{abstract}
\pacs{PACS numbers: 61.12.Ex, 61.25.Hq, 82.70.Dd, 83.70.Hq}
64.70.Pf Glass transitions
82.70.Dd Colloids.
\begin{multicols}{2}
\smallskip%
%
%
%
Recently a large number of novel dynamical arrest phenomena have been
described in
systems where, besides the usual hard core, an attractive potential is
present with a range much smaller than the hard core radius
\cite{fabbian99,bergenholtz99,foffi01}.
This condition is not usually met in molecular liquid
systems, where the attractive range is of the same order of magnitude as
the hard core, but
can be realized in colloidal systems where the size of the particles
largely exceeds the range of the attractive part of the
potential\cite{lekkerkerker,poon,bartschlog,bartsch,verduin95}, and possibly
many other systems of experimental interest, including globular
proteins \cite{proteincrystallization,buckyballs}.
%
% EXPERIMENTS
%
From the
experimental point of view the most striking phenomenon associated
with the attraction is the gradual disappearance of the liquid phase
when the range of the attractive part of the potential diminishes.
Ultimately, for narrower wells, the liquid-gas coexistence becomes
metastable with respect to a crystal-fluid equilibrium, but
nevertheless shows up as a metastable binodal curve in
experiments \cite{verduin95} and in simulations \cite{auer01}.
Various approximations to the liquid and crystalline free
energies have been used in order to calculate the coexistence lines
and for various forms of the attractive part of the interaction
potential\cite{barker,gast,evans,foffi02}.
%Another interesting fact is the existence of
%a solid-solid coexistence line at high volume fractions.
%
% METASTABLE PHASE DIAGRAM
%
While the situation of the equilibrium phase diagram is quite
clear, the metastable region of the phase-diagram related to the supercooled
fluid is quite complex, and only partially clarified
\cite{verduin95,segre,lai}.
It is now widely accepted that mode-coupling theory (MCT) provides
a description of supercooled dynamics which is particularly
suitable for understanding colloidal systems. MCT predicts in
particular the existence of a non-ergodicity transition which
corresponds to a structural arrest, i.e. the impossibility of the
particles of the system to move under the effect of the
neighboring ones, the so-called cage
effect\cite{goetze91,goetze92}. Some measurements performed in
colloidal systems support the MCT predictions in more quantitative
detail\cite{goetze99,vanmengen9394}.
%
% ATTRACTIVE AND REPULSIVE GLASS LINES
%
More recently MCT has been applied to systems interacting through
a short ranged attractive potential, with the result of predicting a number of
new and interesting phenomena
\cite{fabbian99,bergenholtz99,dawson00,fuchscondmat}. Amongst the
most striking is the possibility to distinguish two
types of transition from a supercooled liquid to a glass, one mainly
due to the repulsive part of the potential through the usual mechanism
of the cage effect, the other to the attractive part of the potential.
The latter mechanism is due to the adhesiveness of the potential
at short distances which produces `clusters'
of particles, a different mechanism of structural arrest than
the `blocking' or `jamming' familiar in hard sphere
systems. The attractive branch of glass transition curve that
results extends from low values of the volume fraction $\phi$ to
values of the order of the hard sphere transition and does not
vary much with temperature. The repulsive glass curve passes from
the hard sphere value at high temperatures to larger values of
$\phi$ as temperature decreases, thereby giving rise to a
re-entrant phenomenon, i.e. the supercooled liquid phase extends
into the glass region above the volume fractions of the pure hard
spheres system. It is then possible, raising the temperature at
constant volume fraction, to move from the attractive glass region
to the supercooled fluid one and again in the amorphous
hard-sphere-like glass region. We note in passing that the
complementary possibility of driving the system across a glass
transition both by increasing and decreasing the density has been
shown to be possible in systems with long range interactions
(Wigner glasses)\cite{bosse}.
%
% GLASS-GLASS TRANSITION
%
In the case here under scrutiny, at high values of $\phi$, the two
branches of the glass curves cross at an angle, and the attractive
branch continues further into the glass region, giving rise to a
remarkable coexistence of two different types of glass which can
be characterized, for example, by their mechanical properties such
as the shear modulus\cite{zaccarelli01}. The glass-glass curve
terminates in a special singular point of the theory, named $A_3$
in the MCT, where the relaxation processes have a peculiar
behavior \cite{sjoegren}.
Upon narrowing the width of the attractive
potential, the glass-glass transition line tends to become shorter
until it vanishes in a point which represents a high order
singularity, an $A_4$ singularity in the MCT language \cite{dawson00}.
%
% EXP
%
The experimental and/or numerical verifications of these predictions
are still scarce\cite{fuchscondmat,bartschlog}. A logarithmic decay,
predicted by MCT close to the $A_3$ point, was detected in particular
in a micellar system at high packing fractions\cite{mallamace00}. It
is interesting to note the possible application of this type of
results to the study of protein crystallization
\cite{foffi02,proteincrystallization}.
We focus in this paper on a particular aspect of the attractive
colloidal system, that is the extension of the glass transition line
to high values of the packing fraction, in order to test one of the important
predictions of the theory, i.e. the re-entrant behavior of the
supercooled fluid-glass line.
%
% SYSTEM
%
We simulate a monodisperse sample of $N=1237$ particles of unit
mass with a constant diameter $\sigma=1$ in a cubic box.
The physical quantities are measured in units of the particle diameter
$\sigma$, the particle mass $m$, and the square well depth $u_0$
as unit of energy. Temperature $T$ is measured in units of energy,
i.e. by setting the Boltzmann constant $k_B=1$.
With these choices, time is measured in units of
$\sigma (m/u_o)^{1/2}$. The interparticle potential $V(r)$ is
the square well potential,
\begin{eqnarray}
V(r)&=&\infty~~~~~~~~~~~~~~~~~~ r<\sigma \nonumber\\
V(r)&=&-u_0~~~~~~\sigma<r<\sigma+\Delta \nonumber\\
V(r)&=&0~~~~~~~~~~~~~r>\sigma+\Delta
\end{eqnarray}
The width of the attractive part of the potential is $\Delta=0.0309$,
corresponding to
a percentage variation $\epsilon=\Delta/(\sigma+\Delta)=0.03$.
We have investigated volume fractions from $0.10$ to $\approx0.58$ and
temperatures from $T=0.32$ to $50$. For $T$ lower than $0.32$ the homogeneous
fluid phase is unstable with respect to gas-liquid
phase-separation.
MCT calculations, based both on the Percus-Yevick (PY) and Mean Spherical
Approximation (MSA) structure factors \cite{dawson00},
predict, for this specific potential, a reentrant fluid-glass line,
as discussed in what follows.
%
% ALGORITHM
%
We have implemented the standard MD algorithm for particles
interacting with SW potentials\cite{rapaport}. Between collisions,
particles move along straight lines with constant velocities. When the
distance between the particles becomes equal to the distance for which
$V(r)$ has a discontinuity, the velocities of the interacting
particles instantaneously change. The algorithm calculates the
shortest collision time in the system and propagate the trajectory
from one collision to the next one. Calculations of the next
collision time are optimized by dividing the system in small
subsystems, so that collision time are computed only between particles
in the neighboring subsystems.
For each run we have used particular care in equilibrating the system,
and starting from an equilibrated configuration we have performed a
simulation up to a time $10^3$.
Runs exhibiting the
presence of crystalline nucleus at the end of the simulations were
discarded. Since we simulate a monodisperse system,
the formation of a crystal phase fixes the range of packing fractions
where a stable (or metastable) fluid phase can be studied.
We have calculated the self-diffusion coefficient $D$ in the
supercooled liquid phase via the long time limit of
the mean squared displacement of the particles.
For each of the 10 studied isotherms,
$D$ varies almost over three decades, showing a marked
decrease at high volume fractions, before crystallization takes place.
%
%
%
Fig.\ref{fig:D} shows the diffusion coefficient $D$ as a function of the
packing fraction $\phi \equiv N \pi \sigma^3/(6V)$ for the
studied isotherms. The $T=50$ isotherm diffusivity reproduces the
hard sphere behavior. For each isotherm,
simulations at larger volume fraction than the ones reported
inevitably lead to crystallization during the run.
Fig.\ref{fig:D} shows that, when the kinetic energy is of the
order of the potential depth (e.g. $T=0.75$) ,
crystallization is shifted to larger
packing fraction values as compared to both the hard-sphere case
(e.g. $T=50$) and to low $T$ (e.g. $T=0.35$).
%To better compare the behavior of different isotherms and the
%possible correlation between
%the greater stability against crystallization
%which takes place around $T=0.75$ and the slowing down of
%the relaxation time.
Fig.\ref{fig:2} shows the diffusivity behavior in the $\phi$ region where the
reentrant phenomenon takes place. Data are
normalized by $D_o\equiv \sigma \sqrt{T/m}$,
in order to take into account the $T$ dependence of the microscopic time.
We see that on decreasing $T$ at constant $\phi$, $D/D_o$ first
increases and then decreases again. Since the $T^{1/2}$ term in $D_o$
accounts already for the slowing down of the dynamics associated to
the different average particle velocity, the increase of $D/D_o$ on
cooling must have a different origin. This peculiar feature can be
explained as a result of the competition between two different
dynamical features produced by the increased bonding: (i) slowing down
of the dynamics due to the formation of a larger number of bonded
pairs and (ii) speeding up of the dynamics due to the larger free
volume resulting from the more efficient packing of the bonded
particles--- whose nearest neighbor distance is now imposed by the
short range of the potential. The inset of Fig.\ref{fig:2} shows all
the studied state points. At all $T$, the low density limit coincides
with the hard sphere behavior.
%On lowering the temperature the packing fraction where $D$ tends to
%converge to zero tends to increase up to roughly $T=0.75$ and then
%decrease further increasing $T$, clearly showing the re-entrant behavior.
%The anomalous decrease of $D/D_0$ extends almost over three decades
%when approaching large volume fractions.
%Although the decay law spans less than three decades, it can be tentatively
%represented by the power-law predicted by MCT, with
%an exponent $\gamma \approx 2.2$ which corresponds to a value of the
%exponent parameter $\lambda= ...$.
Fig.~\ref{fig:3} reports the isodiffusivity curves, i.e. curves at
constant $D/D_0$ value, in the ($\phi,T$) plane. It also reports the
curve where crystallization takes place within the time of our
calculation. The isodiffusivity curves shown in Fig.~\ref{fig:3} can
be considered as the precursor of the fluid-glass transition line that
would take place when $D/D_0 \rightarrow 0$ if crystallization would
not occur first. The inset of Fig.~\ref{fig:3} shows the MCT
calculations for the same model as reported in \cite{dawson00}. As in
all cases studied previously, the MCT calculation underestimates the
location of the glass transition line but provides a correct frame for
understanding the reentrant behavior observed in the present
calculations.
In summary, we have established the presence of reentrance
in the dynamical arrest behavior of an extremely simple
model, the square well one, when the width of the
attractive potential is much smaller than the hard-core radius.
This condition can be met in colloidal systems.
This observed behavior, predicted by MCT, along with
a number of other associated phenomena, is explained as
competition between the hard-core caging --- characteristic of
the hard-core systems --- and the bonding caging which, in the case
of very short range potential, localizes the particles in a
more efficient manner than the hard core case.
This stronger localization, imposed by
incipient 'bonding' provides extra free volume which leads to more
diffusional pathways. Further lowering of the temperature produces
stronger cages, and the system then crosses over to the attractive
glass scenario.
%This stronger localization imposed by bonding provides extra
%free volume for diffusion which appear to speed up the dynamics.
%The results reported in this article confirms that
%comparing the hard-sphere and the short range SW potential,
%the more efficient localization mechanism created by bonding provides
%an additional free volume to the system as a whole and hence a faster dynamics.
It is an open challenge to find out in future if
other MCT predictions are supported by numerical investigation.
This additional work, which requires the study of larger values
of $\phi$ and larger simulation time windows to better characterize
the slow dynamics --- based on SW
binary mixture systems to prevent crystallization ---
is underway.
% ACK
%
This research is supported by the INFM-HOP-1999, MURST-PRIN-2000 and
COST P1. S.B. thanks the University of Rome for granting him a
visiting Professorship position.
\begin{references}
\bibitem{fabbian99}
L. Fabbian, W. G\"otze, F. Sciortino, P. Tartaglia and F. Thiery,
Phys. Rev. E {\bf 59}, R1347 (1999) and {\bf 60}, 2430 (1999).
\bibitem{bergenholtz99}
J. Bergenholtz and M. Fuchs,
Phys. Rev. E {\bf 59}, 5706 (1999).
\bibitem{foffi01}
G. Foffi, E. Zaccarelli, F. Sciortino, P. Tartaglia and K. A. Dawson
J. Stat. Phys {\bf 100}, 363 (2000).
\bibitem{lekkerkerker}
H. N. W. Lekkerkerker, W. C. Poon, P. N. Pusey, A. Stroobants
and P. B. Warren, Europhys. Lett. {\bf 20}, 559 (1992).
\bibitem{poon}
P. N. Pusey, A. D. Pirie and W. C. K. Poon, Physica A {\bf 201},
322 (1993); P. N. Pusey, P. N. Segr\`{e}, O. P. Behrend,
S. P. Meeker and W. C. K. Poon, Physica A {\bf 235}, 1 (1996);
W. C. K. Poon, Curr. Opin. Colloid Interface Sci. {\bf 3}, 593 (1998).
\bibitem{bartschlog}
E. Bartsch, M. Antonietti, W. Shupp and H. Sillescu,
J. Chem. Phys. {\bf 97}, 3950 (1992).
\bibitem{bartsch}
E. Bartsch, V. Frenz, J. Baschnagel, W. Sch\"artl and H. Sillescu
J. Chem. Phys. {\bf 106}, 3743 (1997); A. Kasper, E. Bartsch and
H. Sillescu, Langmuir {\bf 14}, 5004 (1998).
\bibitem{verduin95}
H. Verduin and J. K. G. Dhont, J. Colloid Interface Sci. {\bf 172},
425 (1995).
\bibitem{proteincrystallization}
R. Piazza, Curr. Opin. Colloid Interface Sci. {\bf 5}, 38
(2000); M. Mushol and F. Rosenberg, J. Chem. Phys. {\bf 103}
10424 (1995); D. F. Rosebaum, A. Kulkarmi, S. Ramakrishnan and
C. F. Zukoski, J. Chem. Phys. {\bf 111}, 9882 (1999).
\bibitem{buckyballs}
M. H. J. Hagen, E. J. Mejer, G. Mooji, D. Frenkel,
H. N. W Lekkerkerker, Nature {\bf 365}, 425 (1993).
\bibitem{auer01} S. Auer and D. Frenkel, Nature {\bf 409}, 1020 (2001).
\bibitem{barker}
J. A. Barker and D. J. Henderson,
J. Chem.Phys {\bf 47}, 2856 (1967).
\bibitem{gast}
A. P.Gast, W. B. Russell and C. K. Hall,
J. Colloid Interface Sci. {\bf 96}, 1977 (1983);
A. P.Gast, W. B. Russell and C. K. Hall,
J. Colloid Interface Sci. {\bf 109}, 161 (1986).
\bibitem{evans}
M. Dijkstra, J. M. Brader and R. Evans
J.Phys.:Condens. Matter {\bf 11}, 10079 (1999).
\bibitem{foffi02}
G. Foffi, G. D. McCullagh, A. Lawlor, E. Zaccarelli,
K. A. Dawson, F. Sciortino, P. Tartaglia, D. Pini and G. Stell,
Phys. Rev. E, in press (2002), condmat/0111221.
\bibitem{segre}
P. N. Segr\`e, V. Prasad, A. B. Schofield and D. A. Weitz,
Phys. Rev. Lett. {\bf 86}, 6042 (2000).
\bibitem{lai}
G. F. Wang and S. K. Lai, Phys. Rev. Lett. {\bf 81}, 3645 (1999).
\bibitem{goetze91}
W. G\"{o}tze,
in {\it Liquids, Freezing and the Glass Transition},
edited by J. P. Hansen, D. Levesque, and J. Zinn-Justin
(North Holland, Amsterdam, 1991), p.287.
\bibitem{goetze92}
W. G\"{o}tze and L. Sj\"{o}gren,
Rep. Prog. Phys. {\bf 55}, 241 (1992).
\bibitem{goetze99}
W. G\"{o}tze,
J. Phys.: Condens. Matter {\bf 11}, A1 (1999).
\bibitem{vanmengen9394}
W. van Megen and S. M. Underwood,
Phys. Rev. Lett. {\bf 70}, 2766 (1993),
Phys. Rev. E {\bf 49}, 4206 (1994).
\bibitem{dawson00}
K. A. Dawson, G. Foffi, M. Fuchs, W. G\"otze, F. Sciortino, M. Sperl,
P. Tartaglia, Th. Voigtmann and E. Zaccarelli,
Phys. Rev. E {\bf 63}, 1140 (2000).
\bibitem{fuchscondmat}
A. M. Puertas, M. Fuchs and M. E. Cates, condmat/0109373.
\bibitem{bosse}
J. Bosse and S. D. Wilke, Phys. Rev. Lett. {\bf 80}, 1260 (1998).
\bibitem{zaccarelli01}
E. Zaccarelli, G. Foffi, P. Tartaglia, F. Sciortino and K. A.
Dawson, Phys. Rev E, {\bf 63}, 031501 (2001).
\bibitem{sjoegren}
L. Sj\"{o}gren,
J. Phys.: Condens. Matter {\bf 3}, 5023 (1991).
\bibitem{mallamace00}
F. Mallamace, P. Gambadauro, N. Micali, P. Tartaglia,
C. Liao and S. H. Chen,
Phys. Rev. Lett. {\bf 84}, 5431 (2000).
\bibitem{rapaport}
D. C. Rapaport, {\it The Art of Molecular Dynamic Simulation},
Cambridge University Press, 1995.
\end{references}
\newpage
\begin{figure}
%\hbox to\hsize{\epsfxsize=1.0\hsize\hfil\epsfbox{fig-1.eps}
%\hfil}
\centerline{\psfig{figure=fig-1.eps,width=9.cm,clip=,angle=0.}
}
\caption{
Diffusion coefficient $D$ as a function of the
packing fraction $\phi$ for the $\epsilon=0.03$ square well
potential at several different $T$.
}
\label{fig:D}
\end{figure}
\vspace{10cm}
\begin{figure}
\centerline{\psfig{figure=fig-2.eps,width=9.cm,clip=,angle=0.}
}
\caption{
Scaled diffusivity $D/D_o$ $(D_o=\sigma (T/m)^{0.5})$
as a function of packing fraction $\phi$ for the SW potential for some of the
studied isotherms.
The inset shows an enlarged $\phi$ window to highlight the
common low density limit.
}
\label{fig:2}
\end{figure}
\vspace{3.5cm}
\begin{figure}
%\hbox to\hsize{\epsfxsize=1.0\hsize\hfil\epsfbox{fig-3.eps}\hfil}
\centerline{\psfig{figure=fig-3.eps,width=9.cm,clip=,angle=0.}
}
\caption{
Iso diffusivity curves in the $(\phi,T)$ phase diagram with
$D/D_o=0.05$(triangles), $0.04$(squares), $0.025$(crosses). The dashed
line with filled circles represents the line where the system crystallizes
within our maximum simulation time. The inset shows the theoretical
MCT prediction for the ideal glass line (redrawn from
Ref.\protect\cite{dawson00}) for both Percus Yevick (PY-filled
diamonds) and Mean Spherical Approximation (MSA-open circles),
separating the fluid phase from the glass phase. }
\label{fig:3}
\end{figure}
\end{multicols}
\end{document}
% Psfig/TeX Release 1.8
% dvips version
%
% All psfig/tex software, documentation, and related files
% in this distribution of psfig/tex are
% Copyright 1987, 1988, 1991 Trevor J. Darrell
%
% Permission is granted for use and non-profit distribution of psfig/tex
% providing that this notice is clearly maintained. The right to
% distribute any portion of psfig/tex for profit or as part of any commercial
% product is specifically reserved for the author(s) of that portion.
%
% *** Feel free to make local modifications of psfig as you wish,
% *** but DO NOT post any changed or modified versions of ``psfig''
% *** directly to the net. Send them to me and I'll try to incorporate
% *** them into future versions. If you want to take the psfig code
% *** and make a new program (subject to the copyright above), distribute it,
% *** (and maintain it) that's fine, just don't call it psfig.
%
% Bugs and improvements to trevor@media.mit.edu.
%
% Thanks to Greg Hager (GDH) and Ned Batchelder for their contributions
% to the original version of this project.
%
% Modified by J. Daniel Smith on 9 October 1990 to accept the
% %%BoundingBox: comment with or without a space after the colon. Stole
% file reading code from Tom Rokicki's EPSF.TEX file (see below).
%
% More modifications by J. Daniel Smith on 29 March 1991 to allow the
% the included PostScript figure to be rotated. The amount of
% rotation is specified by the "angle=" parameter of the \psfig command.
%
% Modified by Robert Russell on June 25, 1991 to allow users to specify
% .ps filenames which don't yet exist, provided they explicitly provide
% boundingbox information via the \psfig command. Note: This will only work
% if the "file=" parameter follows all four "bb???=" parameters in the
% command. This is due to the order in which psfig interprets these params.
%
% 3 Jul 1991 JDS check if file already read in once
% 4 Sep 1991 JDS fixed incorrect computation of rotated
% bounding box
% 25 Sep 1991 GVR expanded synopsis of \psfig
% 14 Oct 1991 JDS \fbox code from LaTeX so \psdraft works with TeX
% changed \typeout to \ps@typeout
% 17 Oct 1991 JDS added \psscalefirst and \psrotatefirst
%
% From: gvr@cs.brown.edu (George V. Reilly)
%
% \psdraft draws an outline box, but doesn't include the figure
% in the DVI file. Useful for previewing.
%
% \psfull includes the figure in the DVI file (default).
%
% \psscalefirst width= or height= specifies the size of the figure
% before rotation.
% \psrotatefirst (default) width= or height= specifies the size of the
% figure after rotation. Asymetric figures will
% appear to shrink.
%
% \psfigurepath#1 sets the path to search for the figure
%
% \psfig
% usage: \psfig{file=, figure=, height=, width=,
% bbllx=, bblly=, bburx=, bbury=,
% rheight=, rwidth=, clip=, angle=, silent=}
%
% "file" is the filename. If no path name is specified and the
% file is not found in the current directory,
% it will be looked for in directory \psfigurepath.
% "figure" is a synonym for "file".
% By default, the width and height of the figure are taken from
% the BoundingBox of the figure.
% If "width" is specified, the figure is scaled so that it has
% the specified width. Its height changes proportionately.
% If "height" is specified, the figure is scaled so that it has
% the specified height. Its width changes proportionately.
% If both "width" and "height" are specified, the figure is scaled
% anamorphically.
% "bbllx", "bblly", "bburx", and "bbury" control the PostScript
% BoundingBox. If these four values are specified
% *before* the "file" option, the PSFIG will not try to
% open the PostScript file.
% "rheight" and "rwidth" are the reserved height and width
% of the figure, i.e., how big TeX actually thinks
% the figure is. They default to "width" and "height".
% The "clip" option ensures that no portion of the figure will
% appear outside its BoundingBox. "clip=" is a switch and
% takes no value, but the `=' must be present.
% The "angle" option specifies the angle of rotation (degrees, ccw).
% The "silent" option makes \psfig work silently.
%
% check to see if macros already loaded in (maybe some other file says
% "\input psfig") ...
\ifx\undefined\psfig\else\endinput\fi
%
% from a suggestion by eijkhout@csrd.uiuc.edu to allow
% loading as a style file:
\edef\psfigRestoreAt{\catcode`@=\number\catcode`@\relax}
\catcode`\@=11\relax
\newwrite\@unused
\def\ps@typeout#1{{\let\protect\string\immediate\write\@unused{#1}}}
\ps@typeout{psfig/tex 1.8}
%% Here's how you define your figure path. Should be set up with null
%% default and a user useable definition.
\def\figurepath{./}
\def\psfigurepath#1{\edef\figurepath{#1}}
%
% @psdo control structure -- similar to Latex @for.
% I redefined these with different names so that psfig can
% be used with TeX as well as LaTeX, and so that it will not
% be vunerable to future changes in LaTeX's internal
% control structure,
%
\def\@nnil{\@nil}
\def\@empty{}
\def\@psdonoop#1\@@#2#3{}
\def\@psdo#1:=#2\do#3{\edef\@psdotmp{#2}\ifx\@psdotmp\@empty \else
\expandafter\@psdoloop#2,\@nil,\@nil\@@#1{#3}\fi}
\def\@psdoloop#1,#2,#3\@@#4#5{\def#4{#1}\ifx #4\@nnil \else
#5\def#4{#2}\ifx #4\@nnil \else#5\@ipsdoloop #3\@@#4{#5}\fi\fi}
\def\@ipsdoloop#1,#2\@@#3#4{\def#3{#1}\ifx #3\@nnil
\let\@nextwhile=\@psdonoop \else
#4\relax\let\@nextwhile=\@ipsdoloop\fi\@nextwhile#2\@@#3{#4}}
\def\@tpsdo#1:=#2\do#3{\xdef\@psdotmp{#2}\ifx\@psdotmp\@empty \else
\@tpsdoloop#2\@nil\@nil\@@#1{#3}\fi}
\def\@tpsdoloop#1#2\@@#3#4{\def#3{#1}\ifx #3\@nnil
\let\@nextwhile=\@psdonoop \else
#4\relax\let\@nextwhile=\@tpsdoloop\fi\@nextwhile#2\@@#3{#4}}
%
% \fbox is defined in latex.tex; so if \fbox is undefined, assume that
% we are not in LaTeX.
% Perhaps this could be done better???
\ifx\undefined\fbox
% \fbox code from modified slightly from LaTeX
\newdimen\fboxrule
\newdimen\fboxsep
\newdimen\ps@tempdima
\newbox\ps@tempboxa
\fboxsep = 3pt
\fboxrule = .4pt
\long\def\fbox#1{\leavevmode\setbox\ps@tempboxa\hbox{#1}\ps@tempdima\fboxrule
\advance\ps@tempdima \fboxsep \advance\ps@tempdima \dp\ps@tempboxa
\hbox{\lower \ps@tempdima\hbox
{\vbox{\hrule height \fboxrule
\hbox{\vrule width \fboxrule \hskip\fboxsep
\vbox{\vskip\fboxsep \box\ps@tempboxa\vskip\fboxsep}\hskip
\fboxsep\vrule width \fboxrule}
\hrule height \fboxrule}}}}
\fi
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% file reading stuff from epsf.tex
% EPSF.TEX macro file:
% Written by Tomas Rokicki of Radical Eye Software, 29 Mar 1989.
% Revised by Don Knuth, 3 Jan 1990.
% Revised by Tomas Rokicki to accept bounding boxes with no
% space after the colon, 18 Jul 1990.
% Portions modified/removed for use in PSFIG package by
% J. Daniel Smith, 9 October 1990.
%
\newread\ps@stream
\newif\ifnot@eof % continue looking for the bounding box?
\newif\if@noisy % report what you're making?
\newif\if@atend % %%BoundingBox: has (at end) specification
\newif\if@psfile % does this look like a PostScript file?
%
% PostScript files should start with `%!'
%
{\catcode`\%=12\global\gdef\epsf@start{%!}}
\def\epsf@PS{PS}
%
\def\epsf@getbb#1{%
%
% The first thing we need to do is to open the
% PostScript file, if possible.
%
\openin\ps@stream=#1
\ifeof\ps@stream\ps@typeout{Error, File #1 not found}\else
%
% Okay, we got it. Now we'll scan lines until we find one that doesn't
% start with %. We're looking for the bounding box comment.
%
{\not@eoftrue \chardef\other=12
\def\do##1{\catcode`##1=\other}\dospecials \catcode`\ =10
\loop
\if@psfile
\read\ps@stream to \epsf@fileline
\else{
\obeyspaces
\read\ps@stream to \epsf@tmp\global\let\epsf@fileline\epsf@tmp}
\fi
\ifeof\ps@stream\not@eoffalse\else
%
% Check the first line for `%!'. Issue a warning message if its not
% there, since the file might not be a PostScript file.
%
\if@psfile\else
\expandafter\epsf@test\epsf@fileline:. \\%
\fi
%
% We check to see if the first character is a % sign;
% if so, we look further and stop only if the line begins with
% `%%BoundingBox:' and the `(atend)' specification was not found.
% That is, the only way to stop is when the end of file is reached,
% or a `%%BoundingBox: llx lly urx ury' line is found.
%
\expandafter\epsf@aux\epsf@fileline:. \\%
\fi
\ifnot@eof\repeat
}\closein\ps@stream\fi}%
%
% This tests if the file we are reading looks like a PostScript file.
%
\long\def\epsf@test#1#2#3:#4\\{\def\epsf@testit{#1#2}
\ifx\epsf@testit\epsf@start\else
\ps@typeout{Warning! File does not start with `\epsf@start'. It may not be a PostScript file.}
\fi
\@psfiletrue} % don't test after 1st line
%
% We still need to define the tricky \epsf@aux macro. This requires
% a couple of magic constants for comparison purposes.
%
{\catcode`\%=12\global\let\epsf@percent=%\global\def\epsf@bblit{%BoundingBox}}
%
%
% So we're ready to check for `%BoundingBox:' and to grab the
% values if they are found. We continue searching if `(at end)'
% was found after the `%BoundingBox:'.
%
\long\def\epsf@aux#1#2:#3\\{\ifx#1\epsf@percent
\def\epsf@testit{#2}\ifx\epsf@testit\epsf@bblit
\@atendfalse
\epsf@atend #3 . \\%
\if@atend
\if@verbose{
\ps@typeout{psfig: found `(atend)'; continuing search}
}\fi
\else
\epsf@grab #3 . . . \\%
\not@eoffalse
\global\no@bbfalse
\fi
\fi\fi}%
%
% Here we grab the values and stuff them in the appropriate definitions.
%
\def\epsf@grab #1 #2 #3 #4 #5\\{%
\global\def\epsf@llx{#1}\ifx\epsf@llx\empty
\epsf@grab #2 #3 #4 #5 .\\\else
\global\def\epsf@lly{#2}%
\global\def\epsf@urx{#3}\global\def\epsf@ury{#4}\fi}%
%
% Determine if the stuff following the %%BoundingBox is `(atend)'
% J. Daniel Smith. Copied from \epsf@grab above.
%
\def\epsf@atendlit{(atend)}
\def\epsf@atend #1 #2 #3\\{%
\def\epsf@tmp{#1}\ifx\epsf@tmp\empty
\epsf@atend #2 #3 .\\\else
\ifx\epsf@tmp\epsf@atendlit\@atendtrue\fi\fi}
% End of file reading stuff from epsf.tex
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% trigonometry stuff from "trig.tex"
\chardef\letter = 11
\chardef\other = 12
\newif \ifdebug %%% turn me on to see TeX hard at work ...
\newif\ifc@mpute %%% don't need to compute some values
\c@mputetrue % but assume that we do
\let\then = \relax
\def\r@dian{pt }
\let\r@dians = \r@dian
\let\dimensionless@nit = \r@dian
\let\dimensionless@nits = \dimensionless@nit
\def\internal@nit{sp }
\let\internal@nits = \internal@nit
\newif\ifstillc@nverging
\def \Mess@ge #1{\ifdebug \then \message {#1} \fi}
{ %%% Things that need abnormal catcodes %%%
\catcode `\@ = \letter
\gdef \nodimen {\expandafter \n@dimen \the \dimen}
\gdef \term #1 #2 #3%
{\edef \t@ {\the #1}%%% freeze parameter 1 (count, by value)
\edef \t@@ {\expandafter \n@dimen \the #2\r@dian}%
%%% freeze parameter 2 (dimen, by value)
\t@rm {\t@} {\t@@} {#3}%
}
\gdef \t@rm #1 #2 #3%
{{%
\count 0 = 0
\dimen 0 = 1 \dimensionless@nit
\dimen 2 = #2\relax
\Mess@ge {Calculating term #1 of \nodimen 2}%
\loop
\ifnum \count 0 < #1
\then \advance \count 0 by 1
\Mess@ge {Iteration \the \count 0 \space}%
\Multiply \dimen 0 by {\dimen 2}%
\Mess@ge {After multiplication, term = \nodimen 0}%
\Divide \dimen 0 by {\count 0}%
\Mess@ge {After division, term = \nodimen 0}%
\repeat
\Mess@ge {Final value for term #1 of
\nodimen 2 \space is \nodimen 0}%
\xdef \Term {#3 = \nodimen 0 \r@dians}%
\aftergroup \Term
}}
\catcode `\p = \other
\catcode `\t = \other
\gdef \n@dimen #1pt{#1} %%% throw away the ``pt''
}
\def \Divide #1by #2{\divide #1 by #2} %%% just a synonym
\def \Multiply #1by #2%%% allows division of a dimen by a dimen
{{%%% should really freeze parameter 2 (dimen, passed by value)
\count 0 = #1\relax
\count 2 = #2\relax
\count 4 = 65536
\Mess@ge {Before scaling, count 0 = \the \count 0 \space and
count 2 = \the \count 2}%
\ifnum \count 0 > 32767 %%% do our best to avoid overflow
\then \divide \count 0 by 4
\divide \count 4 by 4
\else \ifnum \count 0 < -32767
\then \divide \count 0 by 4
\divide \count 4 by 4
\else
\fi
\fi
\ifnum \count 2 > 32767 %%% while retaining reasonable accuracy
\then \divide \count 2 by 4
\divide \count 4 by 4
\else \ifnum \count 2 < -32767
\then \divide \count 2 by 4
\divide \count 4 by 4
\else
\fi
\fi
\multiply \count 0 by \count 2
\divide \count 0 by \count 4
\xdef \product {#1 = \the \count 0 \internal@nits}%
\aftergroup \product
}}
\def\r@duce{\ifdim\dimen0 > 90\r@dian \then % sin(x+90) = sin(180-x)
\multiply\dimen0 by -1
\advance\dimen0 by 180\r@dian
\r@duce
\else \ifdim\dimen0 < -90\r@dian \then % sin(-x) = sin(360+x)
\advance\dimen0 by 360\r@dian
\r@duce
\fi
\fi}
\def\Sine#1%
{{%
\dimen 0 = #1 \r@dian
\r@duce
\ifdim\dimen0 = -90\r@dian \then
\dimen4 = -1\r@dian
\c@mputefalse
\fi
\ifdim\dimen0 = 90\r@dian \then
\dimen4 = 1\r@dian
\c@mputefalse
\fi
\ifdim\dimen0 = 0\r@dian \then
\dimen4 = 0\r@dian
\c@mputefalse
\fi
%
\ifc@mpute \then
% convert degrees to radians
\divide\dimen0 by 180
\dimen0=3.141592654\dimen0
%
\dimen 2 = 3.1415926535897963\r@dian %%% a well-known constant
\divide\dimen 2 by 2 %%% we only deal with -pi/2 : pi/2
\Mess@ge {Sin: calculating Sin of \nodimen 0}%
\count 0 = 1 %%% see power-series expansion for sine
\dimen 2 = 1 \r@dian %%% ditto
\dimen 4 = 0 \r@dian %%% ditto
\loop
\ifnum \dimen 2 = 0 %%% then we've done
\then \stillc@nvergingfalse
\else \stillc@nvergingtrue
\fi
\ifstillc@nverging %%% then calculate next term
\then \term {\count 0} {\dimen 0} {\dimen 2}%
\advance \count 0 by 2
\count 2 = \count 0
\divide \count 2 by 2
\ifodd \count 2 %%% signs alternate
\then \advance \dimen 4 by \dimen 2
\else \advance \dimen 4 by -\dimen 2
\fi
\repeat
\fi
\xdef \sine {\nodimen 4}%
}}
% Now the Cosine can be calculated easily by calling \Sine
\def\Cosine#1{\ifx\sine\UnDefined\edef\Savesine{\relax}\else
\edef\Savesine{\sine}\fi
{\dimen0=#1\r@dian\advance\dimen0 by 90\r@dian
\Sine{\nodimen 0}
\xdef\cosine{\sine}
\xdef\sine{\Savesine}}}
% end of trig stuff
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\psdraft{
\def\@psdraft{0}
%\ps@typeout{draft level now is \@psdraft \space . }
}
\def\psfull{
\def\@psdraft{100}
%\ps@typeout{draft level now is \@psdraft \space . }
}
\psfull
\newif\if@scalefirst
\def\psscalefirst{\@scalefirsttrue}
\def\psrotatefirst{\@scalefirstfalse}
\psrotatefirst
\newif\if@draftbox
\def\psnodraftbox{
\@draftboxfalse
}
\def\psdraftbox{
\@draftboxtrue
}
\@draftboxtrue
\newif\if@prologfile
\newif\if@postlogfile
\def\pssilent{
\@noisyfalse
}
\def\psnoisy{
\@noisytrue
}
\psnoisy
%%% These are for the option list.
%%% A specification of the form a = b maps to calling \@p@@sa{b}
\newif\if@bbllx
\newif\if@bblly
\newif\if@bburx
\newif\if@bbury
\newif\if@height
\newif\if@width
\newif\if@rheight
\newif\if@rwidth
\newif\if@angle
\newif\if@clip
\newif\if@verbose
\def\@p@@sclip#1{\@cliptrue}
\newif\if@decmpr
%%% GDH 7/26/87 -- changed so that it first looks in the local directory,
%%% then in a specified global directory for the ps file.
%%% RPR 6/25/91 -- changed so that it defaults to user-supplied name if
%%% boundingbox info is specified, assuming graphic will be created by
%%% print time.
%%% TJD 10/19/91 -- added bbfile vs. file distinction, and @decmpr flag
\def\@p@@sfigure#1{\def\@p@sfile{null}\def\@p@sbbfile{null}
\openin1=#1.bb
\ifeof1\closein1
\openin1=\figurepath#1.bb
\ifeof1\closein1
\openin1=#1
\ifeof1\closein1%
\openin1=\figurepath#1
\ifeof1
\ps@typeout{Error, File #1 not found}
\if@bbllx\if@bblly
\if@bburx\if@bbury
\def\@p@sfile{#1}%
\def\@p@sbbfile{#1}%
\@decmprfalse
\fi\fi\fi\fi
\else\closein1
\def\@p@sfile{\figurepath#1}%
\def\@p@sbbfile{\figurepath#1}%
\@decmprfalse
\fi%
\else\closein1%
\def\@p@sfile{#1}
\def\@p@sbbfile{#1}
\@decmprfalse
\fi
\else
\def\@p@sfile{\figurepath#1}
\def\@p@sbbfile{\figurepath#1.bb}
\@decmprtrue
\fi
\else
\def\@p@sfile{#1}
\def\@p@sbbfile{#1.bb}
\@decmprtrue
\fi}
\def\@p@@sfile#1{\@p@@sfigure{#1}}
\def\@p@@sbbllx#1{
%\ps@typeout{bbllx is #1}
\@bbllxtrue
\dimen100=#1
\edef\@p@sbbllx{\number\dimen100}
}
\def\@p@@sbblly#1{
%\ps@typeout{bblly is #1}
\@bbllytrue
\dimen100=#1
\edef\@p@sbblly{\number\dimen100}
}
\def\@p@@sbburx#1{
%\ps@typeout{bburx is #1}
\@bburxtrue
\dimen100=#1
\edef\@p@sbburx{\number\dimen100}
}
\def\@p@@sbbury#1{
%\ps@typeout{bbury is #1}
\@bburytrue
\dimen100=#1
\edef\@p@sbbury{\number\dimen100}
}
\def\@p@@sheight#1{
\@heighttrue
\dimen100=#1
\edef\@p@sheight{\number\dimen100}
%\ps@typeout{Height is \@p@sheight}
}
\def\@p@@swidth#1{
%\ps@typeout{Width is #1}
\@widthtrue
\dimen100=#1
\edef\@p@swidth{\number\dimen100}
}
\def\@p@@srheight#1{
%\ps@typeout{Reserved height is #1}
\@rheighttrue
\dimen100=#1
\edef\@p@srheight{\number\dimen100}
}
\def\@p@@srwidth#1{
%\ps@typeout{Reserved width is #1}
\@rwidthtrue
\dimen100=#1
\edef\@p@srwidth{\number\dimen100}
}
\def\@p@@sangle#1{
%\ps@typeout{Rotation is #1}
\@angletrue
% \dimen100=#1
\edef\@p@sangle{#1} %\number\dimen100}
}
\def\@p@@ssilent#1{
\@verbosefalse
}
\def\@p@@sprolog#1{\@prologfiletrue\def\@prologfileval{#1}}
\def\@p@@spostlog#1{\@postlogfiletrue\def\@postlogfileval{#1}}
\def\@cs@name#1{\csname #1\endcsname}
\def\@setparms#1=#2,{\@cs@name{@p@@s#1}{#2}}
%
% initialize the defaults (size the size of the figure)
%
\def\ps@init@parms{
\@bbllxfalse \@bbllyfalse
\@bburxfalse \@bburyfalse
\@heightfalse \@widthfalse
\@rheightfalse \@rwidthfalse
\def\@p@sbbllx{}\def\@p@sbblly{}
\def\@p@sbburx{}\def\@p@sbbury{}
\def\@p@sheight{}\def\@p@swidth{}
\def\@p@srheight{}\def\@p@srwidth{}
\def\@p@sangle{0}
\def\@p@sfile{} \def\@p@sbbfile{}
\def\@p@scost{10}
\def\@sc{}
\@prologfilefalse
\@postlogfilefalse
\@clipfalse
\if@noisy
\@verbosetrue
\else
\@verbosefalse
\fi
}
%
% Go through the options setting things up.
%
\def\parse@ps@parms#1{
\@psdo\@psfiga:=#1\do
{\expandafter\@setparms\@psfiga,}}
%
% Compute bb height and width
%
\newif\ifno@bb
\def\bb@missing{
\if@verbose{
\ps@typeout{psfig: searching \@p@sbbfile \space for bounding box}
}\fi
\no@bbtrue
\epsf@getbb{\@p@sbbfile}
\ifno@bb \else \bb@cull\epsf@llx\epsf@lly\epsf@urx\epsf@ury\fi
}
\def\bb@cull#1#2#3#4{
\dimen100=#1 bp\edef\@p@sbbllx{\number\dimen100}
\dimen100=#2 bp\edef\@p@sbblly{\number\dimen100}
\dimen100=#3 bp\edef\@p@sbburx{\number\dimen100}
\dimen100=#4 bp\edef\@p@sbbury{\number\dimen100}
\no@bbfalse
}
% rotate point (#1,#2) about (0,0).
% The sine and cosine of the angle are already stored in \sine and
% \cosine. The result is placed in (\p@intvaluex, \p@intvaluey).
\newdimen\p@intvaluex
\newdimen\p@intvaluey
\def\rotate@#1#2{{\dimen0=#1 sp\dimen1=#2 sp
% calculate x' = x \cos\theta - y \sin\theta
\global\p@intvaluex=\cosine\dimen0
\dimen3=\sine\dimen1
\global\advance\p@intvaluex by -\dimen3
% calculate y' = x \sin\theta + y \cos\theta
\global\p@intvaluey=\sine\dimen0
\dimen3=\cosine\dimen1
\global\advance\p@intvaluey by \dimen3
}}
\def\compute@bb{
\no@bbfalse
\if@bbllx \else \no@bbtrue \fi
\if@bblly \else \no@bbtrue \fi
\if@bburx \else \no@bbtrue \fi
\if@bbury \else \no@bbtrue \fi
\ifno@bb \bb@missing \fi
\ifno@bb \ps@typeout{FATAL ERROR: no bb supplied or found}
\no-bb-error
\fi
%
%\ps@typeout{BB: \@p@sbbllx, \@p@sbblly, \@p@sbburx, \@p@sbbury}
%
% store height/width of original (unrotated) bounding box
\count203=\@p@sbburx
\count204=\@p@sbbury
\advance\count203 by -\@p@sbbllx
\advance\count204 by -\@p@sbblly
\edef\ps@bbw{\number\count203}
\edef\ps@bbh{\number\count204}
%\ps@typeout{ psbbh = \ps@bbh, psbbw = \ps@bbw }
\if@angle
\Sine{\@p@sangle}\Cosine{\@p@sangle}
{\dimen100=\maxdimen\xdef\r@p@sbbllx{\number\dimen100}
\xdef\r@p@sbblly{\number\dimen100}
\xdef\r@p@sbburx{-\number\dimen100}
\xdef\r@p@sbbury{-\number\dimen100}}
%
% Need to rotate all four points and take the X-Y extremes of the new
% points as the new bounding box.
\def\minmaxtest{
\ifnum\number\p@intvaluex<\r@p@sbbllx
\xdef\r@p@sbbllx{\number\p@intvaluex}\fi
\ifnum\number\p@intvaluex>\r@p@sbburx
\xdef\r@p@sbburx{\number\p@intvaluex}\fi
\ifnum\number\p@intvaluey<\r@p@sbblly
\xdef\r@p@sbblly{\number\p@intvaluey}\fi
\ifnum\number\p@intvaluey>\r@p@sbbury
\xdef\r@p@sbbury{\number\p@intvaluey}\fi
}
% lower left
\rotate@{\@p@sbbllx}{\@p@sbblly}
\minmaxtest
% upper left
\rotate@{\@p@sbbllx}{\@p@sbbury}
\minmaxtest
% lower right
\rotate@{\@p@sbburx}{\@p@sbblly}
\minmaxtest
% upper right
\rotate@{\@p@sbburx}{\@p@sbbury}
\minmaxtest
\edef\@p@sbbllx{\r@p@sbbllx}\edef\@p@sbblly{\r@p@sbblly}
\edef\@p@sbburx{\r@p@sbburx}\edef\@p@sbbury{\r@p@sbbury}
%\ps@typeout{rotated BB: \r@p@sbbllx, \r@p@sbblly, \r@p@sbburx, \r@p@sbbury}
\fi
\count203=\@p@sbburx
\count204=\@p@sbbury
\advance\count203 by -\@p@sbbllx
\advance\count204 by -\@p@sbblly
\edef\@bbw{\number\count203}
\edef\@bbh{\number\count204}
%\ps@typeout{ bbh = \@bbh, bbw = \@bbw }
}
%
% \in@hundreds performs #1 * (#2 / #3) correct to the hundreds,
% then leaves the result in @result
%
\def\in@hundreds#1#2#3{\count240=#2 \count241=#3
\count100=\count240 % 100 is first digit #2/#3
\divide\count100 by \count241
\count101=\count100
\multiply\count101 by \count241
\advance\count240 by -\count101
\multiply\count240 by 10
\count101=\count240 %101 is second digit of #2/#3
\divide\count101 by \count241
\count102=\count101
\multiply\count102 by \count241
\advance\count240 by -\count102
\multiply\count240 by 10
\count102=\count240 % 102 is the third digit
\divide\count102 by \count241
\count200=#1\count205=0
\count201=\count200
\multiply\count201 by \count100
\advance\count205 by \count201
\count201=\count200
\divide\count201 by 10
\multiply\count201 by \count101
\advance\count205 by \count201
%
\count201=\count200
\divide\count201 by 100
\multiply\count201 by \count102
\advance\count205 by \count201
%
\edef\@result{\number\count205}
}
\def\compute@wfromh{
% computing : width = height * (bbw / bbh)
\in@hundreds{\@p@sheight}{\@bbw}{\@bbh}
%\ps@typeout{ \@p@sheight * \@bbw / \@bbh, = \@result }
\edef\@p@swidth{\@result}
%\ps@typeout{w from h: width is \@p@swidth}
}
\def\compute@hfromw{
% computing : height = width * (bbh / bbw)
\in@hundreds{\@p@swidth}{\@bbh}{\@bbw}
%\ps@typeout{ \@p@swidth * \@bbh / \@bbw = \@result }
\edef\@p@sheight{\@result}
%\ps@typeout{h from w : height is \@p@sheight}
}
\def\compute@handw{
\if@height
\if@width
\else
\compute@wfromh
\fi
\else
\if@width
\compute@hfromw
\else
\edef\@p@sheight{\@bbh}
\edef\@p@swidth{\@bbw}
\fi
\fi
}
\def\compute@resv{
\if@rheight \else \edef\@p@srheight{\@p@sheight} \fi
\if@rwidth \else \edef\@p@srwidth{\@p@swidth} \fi
%\ps@typeout{rheight = \@p@srheight, rwidth = \@p@srwidth}
}
%
% Compute any missing values
\def\compute@sizes{
\compute@bb
\if@scalefirst\if@angle
% at this point the bounding box has been adjsuted correctly for
% rotation. PSFIG does all of its scaling using \@bbh and \@bbw. If
% a width= or height= was specified along with \psscalefirst, then the
% width=/height= value needs to be adjusted to match the new (rotated)
% bounding box size (specifed in \@bbw and \@bbh).
% \ps@bbw width=
% ------- = ----------
% \@bbw new width=
% so `new width=' = (width= * \@bbw) / \ps@bbw; where \ps@bbw is the
% width of the original (unrotated) bounding box.
\if@width
\in@hundreds{\@p@swidth}{\@bbw}{\ps@bbw}
\edef\@p@swidth{\@result}
\fi
\if@height
\in@hundreds{\@p@sheight}{\@bbh}{\ps@bbh}
\edef\@p@sheight{\@result}
\fi
\fi\fi
\compute@handw
\compute@resv}
%
% \psfig
% usage : \psfig{file=, height=, width=, bbllx=, bblly=, bburx=, bbury=,
% rheight=, rwidth=, clip=}
%
% "clip=" is a switch and takes no value, but the `=' must be present.
\def\psfig#1{\vbox {
% do a zero width hard space so that a single
% \psfig in a centering enviornment will behave nicely
%{\setbox0=\hbox{\ }\ \hskip-\wd0}
%
\ps@init@parms
\parse@ps@parms{#1}
\compute@sizes
%
\ifnum\@p@scost<\@psdraft{
%
\special{ps::[begin] \@p@swidth \space \@p@sheight \space
\@p@sbbllx \space \@p@sbblly \space
\@p@sbburx \space \@p@sbbury \space
startTexFig \space }
\if@angle
\special {ps:: \@p@sangle \space rotate \space}
\fi
\if@clip{
\if@verbose{
\ps@typeout{(clip)}
}\fi
\special{ps:: doclip \space }
}\fi
\if@prologfile
\special{ps: plotfile \@prologfileval \space } \fi
\if@decmpr{
\if@verbose{
\ps@typeout{psfig: including \@p@sfile.Z \space }
}\fi
\special{ps: plotfile "`zcat \@p@sfile.Z" \space }
}\else{
\if@verbose{
\ps@typeout{psfig: including \@p@sfile \space }
}\fi
\special{ps: plotfile \@p@sfile \space }
}\fi
\if@postlogfile
\special{ps: plotfile \@postlogfileval \space } \fi
\special{ps::[end] endTexFig \space }
% Create the vbox to reserve the space for the figure
\vbox to \@p@srheight true sp{
\hbox to \@p@srwidth true sp{
\hss
}
\vss
}
}\else{
% draft figure, just reserve the space and print the
% path name.
\if@draftbox{
% Verbose draft: print file name in box
\hbox{\frame{\vbox to \@p@srheight true sp{
\vss
\hbox to \@p@srwidth true sp{ \hss \@p@sfile \hss }
\vss
}}}
}\else{
% Non-verbose draft
\vbox to \@p@srheight true sp{
\vss
\hbox to \@p@srwidth true sp{\hss}
\vss
}
}\fi
}\fi
}}
\psfigRestoreAt