Abraham Loeb$^{\star}$ and Eli Waxman$^{\dagger}$
paper.tex
%\documentstyle[12pt,aasms4]{article}
\documentstyle[11pt,aaspp4]{article}
\input psfig.tex

\def\gsim{\;\rlap{\lower 2.5pt
 \hbox{$\sim$}}\raise 1.5pt\hbox{$>$}\;}
\def\lsim{\;\rlap{\lower 2.5pt
   \hbox{$\sim$}}\raise 1.5pt\hbox{$<$}\;}
\newcommand\beq{\begin{equation}}
\newcommand\eeq{\end{equation}}
\def\lya{Ly$\alpha$~}
\def\v{\vspace{-0.1in}}

\begin{document}

\Large
\centerline{\bf Gamma-ray background from structure }
\centerline{\bf formation in the intergalactic medium} 
\normalsize
\author{\bf Abraham Loeb$^{\star}$ and Eli
Waxman$^{\dagger}$}
\medskip
\noindent
$\star$ Harvard-Smithsonian CfA, 60 Garden Street,
Cambridge, MA 02138, USA\\ 
\noindent
$\dagger$ Department of Condensed Matter Physics,
Weizmann Institute, Rehovot, 76100, Israel

\bigskip
\centerline{\bf To appear in {\it Nature}. (Under press embargo until
published.)}


\vskip 0.2in 
\hrule 
\vskip 0.2in 

{\bf The universe is filled with a diffuse and isotropic extragalactic
background of $\gamma$-ray radiation$^1$, containing roughly equal energy
flux per decade in photon energy between 3 MeV--100 GeV. The origin of this
background is one of the unsolved puzzles in cosmology. Less than a quarter
of the $\gamma$-ray flux can be attributed to unresolved discrete
sources$^{2,3}$, but the remainder appears to constitute a truly diffuse
background whose origin has hitherto been mysterious.  Here we show that
the shock waves induced by gravity during the formation of large-scale
structure in the intergalactic medium, produce a population of
highly-relativistic electrons with a maximum Lorentz factor $\ga 10^7$.
These electrons scatter a small fraction of the microwave background
photons in the present-day universe up to $\gamma$-ray energies, thereby
providing the $\gamma$-ray background.  The predicted diffuse flux agrees
with the observed background over more than four decades in photon energy,
and implies a mean cosmological density of baryons which is consistent with
Big-Bang nucleosynthesis.  }

The universe started from a smooth initial state, with small density
fluctuations that grew in time due to the effect of gravity. The formation
of structure resulted in non-relativistic, collisionless, shock waves in
the baryonic gas due to converging bulk flows, and raised its mean
temperature to $\sim 10^7$ K ($=1$ keV) at the present time$^4$. This is
indeed the characteristic temperature of the warm gas in groups of
galaxies, which are the typical objects forming at the present epoch. The
intergalactic shocks are usually strong, since the gravitationally-induced
bulk flows are often characterized by a high Mach number.  The
intergalactic gas may have also been heated by shocks driven by 
outflows from young galaxies$^{5-7}$.

Collisionless, non-relativistic, shocks are known to generically accelerate
a power-law distribution of relativistic electrons, with a number density
per electron momentum, $p_e$, of $dn_e/dp_e= Kp_e^{-\alpha}$, where $K$ is
a constant$^8$.  The power-law index for strong shocks in a gas with an
adiabatic index $\Gamma=5/3$, is$^{8-10}$, $\alpha=[(r+2)/(r-1)]=2$, where
$r=[(\Gamma+1)/(\Gamma-1)]$ is the shock compression factor. Such an
electron distribution is found in the strong shocks surrounding supernova
remnants in the interstellar medium$^{8}$.  Recent X-ray$^{11,12}$ and
TeV$^{13,14}$ observations of the supernova remnants SN1006 and SNR RX
J1713.7--3946 imply that electrons are accelerated in the remnant shocks up
to an energy $\sim 100$~TeV, and are confined to the collisionless fluid by
magnetic fields.
These shocks have a velocity of order $10^3~{\rm km~s^{-1}}$, similar to
the velocity of the intergalactic shocks we consider here.  The inferred
energy density in relativistic electrons constitutes $1$--$10\%$ of the
post-shock energy density in these remnants, a fraction consistent with the
global ratio between the mean energy density of cosmic-ray electrons and
the turbulent energy density in the interstellar medium of our galaxy.

Since the physics of shock acceleration can be scaled up to intergalactic
distances, it appears natural to assume that a similar population of
relativistic electrons was also produced in the intergalactic medium.  The
maximum Lorentz factor of the accelerated electrons, $\gamma_{\rm max}$, is
set by equating their acceleration and cooling times. The $e$-folding time
for the acceleration of the relativistic electrons is $t_{\rm acc}\sim
(r_{\rm L}c/v_{\rm sh}^2)$, where $v_{\rm sh}=
(\Gamma+1)[kT/(\Gamma-1)m_p]^{1/2}$ is the shock velocity relative to the
unshocked gas, $m_p$ is the proton mass, and $r_{\rm L}$ is the electron
Larmor gyration radius. For an electron with a Lorentz factor $\gamma_e$,
$r_{\rm L}= 5.5\times 10^{-2} (\gamma_7/B_{-7})$ pc, where
$\gamma_{7}=(\gamma_e/10^7)$, and $B_{-7}$ is the magnetic field strength
in units of $0.1\mu$G. A magnetic field amplitude of $0.1$--$1 \mu$G is
often detected in the halos of galaxy clusters$^{15-17}$.  In particular, a
magnetic field amplitude of $\ga 0.1 \mu$G was inferred on the multi-Mpc
scale of the Coma--A1367 supercluster$^{18}$, which provides a good example
for the intergalactic structures of interest here.  For such magnetic field
amplitude we get, $t_{\rm acc}\sim 2\times 10^4~{\rm
yr}~(\gamma_7/B_{-7})(kT/{\rm keV})^{-1}$.

The acceleration time is much shorter than the lifetime of the
intergalactic shocks, which is comparable to the age of the universe.  The
maximum Lorentz factor of the electrons, $\gamma_{\rm max}$, is therefore
not limited by the lifetime of their accelerator, but rather by their
cooling, primarily due to Compton scattering off the cosmic microwave
background$^{19}$.  Synchrotron cooling is negligible for $B_{-7}\la 10$.
The characteristic cooling time due to inverse-Compton scattering is
$t_{\rm cool}=[m_e c/ (4/3) \sigma_T \gamma_e u_{\rm cmb}] =1.2 \times
10^{10}~{\rm yr}\left({\gamma_e/200}\right)^{-1}$, where $m_e$ is the
electron mass, $\sigma_T$ is the Thomson cross-section, and $u_{\rm cmb}$
is the energy density of the cosmic microwave background.  By equating the
acceleration and cooling times, $t_{\rm acc}=t_{\rm cool}$, we find
$\gamma_{\rm max}= 3.7\times 10^7[B_{-7}(kT/{\rm keV})]^{1/2}$.

The estimates given above are valid as long as the electron Larmor radius
is smaller than the coherence length of the magnetic field.  Since the
Larmor radius of the relativistic electrons is extremely small, $r_{\rm
L}\sim0.1{\rm\,pc}$, this condition is satisfied even if the field
coherence length is much shorter than the $\sim$ Mpc scale of the
intergalactic shocks.

All electrons with $\gamma_e>200$ lose their energy over the age of the
universe. The energy of these electrons is converted to a diffuse
background of photons, which are produced through inverse-Compton
scattering of microwave background photons. The initial energy of a
microwave photon, $h\nu_0$, is boosted by the scattering up to an average
value of $h\nu= (4/3) \gamma_e^2 h\nu_0$.  Substituting the mean frequency
of the microwave background photons for $\nu_0$, we find that the
accelerated intergalactic electrons produce a diffuse background of
radiation extending from the UV [$h\nu= 36 (\gamma_e/200)^2$~eV] and up to
extreme $\gamma$-ray energies [$h\nu= 89 \gamma_{7}^2$~GeV]. For a
power-law distribution of relativistic electrons, $dn_e/dp_e=K p_e^{-2}$,
the energy density of the scattered radiation is predicted to be constant
per logarithmic frequency intervals, $\nu(du/d\nu)=Kc/2=u_e/2\ln\gamma_{\rm
max}$.  Here $u_e=Kc\ln\gamma_{\rm max}$~~is the energy density in
relativistic electrons produced by the intergalactic shocks.  If a fraction
$f_{\rm sh}$ of the baryons in the universe were shocked to a
(mass-weighted) mean temperature $T$, and a fraction $\xi_e$ of the shock
thermal energy was transferred to relativistic electrons, then
$u_e=\frac{3}{2}\xi_e f_{\rm sh} n_p kT= 5.1 \times 10^{-16} \xi_e f_{\rm
sh} \left({\Omega_b h_{70}^2/0.04}\right) \left(kT/{\rm keV}\right) ~{\rm
erg~cm^{-3}}$, where $n_p$ is the average proton density, $\Omega_b$ is the
cosmological baryon density parameter, and $h_{70}$ is the Hubble constant
in units of $70~{\rm km~s^{-1}~Mpc^{-1}}$.  By substituting $\ln\gamma_{\rm
max}=\ln (4\times 10^7)$, we then get
\begin{equation}
E^2{dJ\over dE}= 1.1 \left({\xi_e\over 0.05}\right)
\left({\Omega_bh_{70}^2\over 0.04}\right) \left(f_{\rm sh} kT\over {\rm
keV}\right)~~~{\rm keV~cm^{-2}~s^{-1}~sr^{-1}},
\label{eq:flux}
\end{equation}
where $E=h\nu$, and $J$ is the number flux of photons per solid angle.
Adopting the result from hydrodynamic simulations of$^4$ $f_{\rm sh}
(kT/{\rm keV})\sim 1$, the Big-Bang nucleosynthesis value
of$^{20,21}$~~$\Omega_{b}h_{70}^2=0.04^{+.014}_{-.027}$ (based on the
deuterium abundance), and the value of $\xi_e\sim 0.05$ inferred from
non-relativistic collisionless shocks in the interstellar medium, we obtain
a background flux of $\sim1~{\rm keV~cm^{-2}~s^{-1}~sr^{-1}}$ in the photon
energy range of 3 MeV to 100 GeV. As Figure 1 illustrates, this result is
in excellent agreement with the $\gamma$-ray background detected by the
EGRET instrument aboard the CGRO satellite$^1$.  

The sky-averaged contribution of identified extragalactic sources, such as
blazars ($\gamma$-ray loud active-galactic-nuclei), amounts to only $\la
7\%$ of the extragalactic $\gamma$-ray flux$^{3}$.  As shown in Figure 1,
the recent EGRET data is consistent with a luminosity function of faint,
undetected blazars, which could account for only $\la 25\%$ of the
unresolved $\gamma$-ray background$^{2,3}$.  The remainder of the hard
$\gamma$-ray background is expected to be highly isotropic in our model
because it is integrated over a large volume throughout the universe.  Its
large-angle fluctuations should be comparable (to within a factor of a few)
to that of the hard X-ray background, of which$^{25}$ $\sim 40\%$ is
contributed by early-type galaxies at $z\la 1$, since these galaxies trace
the same large scale structure as painted by the comic web of intergalactic
shocks.  This implies a root-mean-square fluctuation amplitude smaller than
$\sim 5\%$ on angular scales larger than a degree$^{26}$.  The predicted
high level of isotropy can serve as a test of our model, as soon as the
isotropy of the $\gamma$-ray background is measured to a higher precision
than presently available.  Another possible test is the spectral distortion
induced in the microwave background band by the low-energy tail of the
non-thermal intergalactic electrons. This distortion is, however, well
below the upper limit inferred from the COBE satellite data$^{27}$.

At photon energies $\la$ MeV the scattered background is sub-dominant
relative to the cumulative flux produced by discrete sources, such as
active galactic nuclei. In particular, the predicted scattered flux amounts
only to $\sim 10$--$15\%$ of the soft X-ray background measured by ROSAT at
1--2 keV, and is consistent with the upper limit of $\sim 20$--$30\%$ on
its unresolved fraction$^{25,28}$.

Most of the $\gamma$-ray background is produced during the latest episode
of shock heating of the intergalactic gas at $z\la 1$, since the mean gas
temperature is expected to decrease rapidly with increasing redshift$^4$.
Furthermore, the photons emitted at redshifts $z\ga 0.5$ lose a significant
fraction of their energy due to the expansion of the universe.  A more
accurate calculation of the $\gamma$-ray background can be achieved by
simulating the hydrodynamic evolution of the intergalactic medium and
injecting a population of accelerated electrons into each fluid element
which passes through a shock, at all redshifts. Such a simulation can yield
both the background flux and its statistical fluctuations on the sky. For a
given cosmological model of structure formation, the derived background
flux will be proportional to $\xi_e$, and will not depend on any other free
parameters.

Although the warm ($\la 10^7~$K) intergalactic medium is expected
theoretically to include a major fraction of the baryons in the present-day
universe, it has not been observed directly as of yet. The soft X-ray
emission from intergalactic structures, such as sheets and filaments or
galaxy groups, is often too faint to be detectable with current
telescopes$^4$. The observed cosmological density of stars$^{21}$,
$\Omega_{\star}h_{70}=3.5\times 10^{-3}$, is an order of magnitude smaller
than the baryon density predicted by Big-Bang nucleosynthesis.  If the
$\gamma$-ray background indeed results from keV shocks in the intergalactic
medium, then we can derive a lower limit on the mean baryon density
required to produce its observed flux. This minimum is obtained by
substituting $\xi_e=1/2$ (equipartition) and $f_{\rm sh}=1$ in equation
(\ref{eq:flux}), yielding $\Omega_{b} h_{70}^2\ga 4\times 10^{-3}$.  The
inferred lower limit is {\it larger} than the observed mass density in
stars.  Thus, if the reality of our model is proven, then this would not
only explain the origin of the diffuse component of the $\gamma$-ray
background, but also provide the first evidence for the ``missing baryons''
(note that even if the truly diffuse component amounts to only $\sim20\%$
of the $\gamma$-ray background flux, the more plausible range of $\xi_e\la
10\%$ yields a lower limit on the baryon density which is still larger than
the mass density in stars).

In our model, the $\gamma$-ray background is produced in the dense
filaments and sheets which channel gas from converging bulk flows in the
intergalactic medium. The densest and hottest shocks occur at the
intersections of these filaments around the locations of clusters of
galaxies. Although the richest accreting clusters may be rare and
contribute a small fraction of the background, they contain the brightest
shocks in the sky and produce the strongest fluctuations in the diffuse
$\gamma$-ray background. Direct detection of these shocks can be used to
calibrate $\xi_e$ in our model. Even a statistical detection of a
cross-correlation signal between background fluctuations and other sources
that trace the same large scale structure, such as galaxies, X-ray gas, the
Sunyaev-Zel'dovich effect, or synchrotron emission from the high energy
electrons in the intergalactic medium, can be used to prove the reality of
our model.  We predict that as cold gas goes through the strong
virialization shock of an accreting cluster, it emits non-thermal radiation
with photon energies between 30 eV and TeV. The shocked gas loses a
fraction $\sim (4.5/7)\times \xi_e\sim3\%$ of its thermal energy in this
process.  For $h\nu \gg 10$ keV, the cooling time of the corresponding
relativistic electrons is shorter than a billion years.  In this regime the
total non-thermal luminosity of the cluster, $L_{\rm nt}$, is limited by
the time it takes the cluster gas to cross the virialization shock,
i.e. $t_{\rm vir}\sim (2~{\rm Mpc}/2\times 10^3~{\rm km~s^{-1}})= 10^{9}$
yr. For a young cluster which shocks gas of total mass $M_{\rm gas}$ to a
virial temperature $T_{\rm gas}$, the total (bolometric) non-thermal
luminosity is
\begin{equation}
L_{\rm nt}\sim \left({4.5\xi_e/7 \over t_{\rm vir}}\right)\left(M_{\rm
gas}\over m_p\right) \left({3\over 2} kT_{\rm gas}\right) = 1.5\times
10^{45} \left({\xi_e\over 0.05}\right) \left({10^9~{\rm yr}\over t_{\rm
vir}}\right) \left({M_{\rm gas}\over 10^{14} M_\odot}\right) \left({kT_{\rm
gas}\over 5~{\rm keV}}\right)~{\rm erg~s^{-1}}.
\label{eq:cluster_luminosity}
\end{equation}
(The total cluster mass, including the dark matter, is typically an order
of magnitude larger than $M_{\rm gas}$.)  The luminosity per each
logarithmic interval in photon energy, anywhere between 30 eV and TeV, is
$\sim 0.1L_{\rm nt}$.  This emission component would affect estimates of
the gas temperature and the thermal luminosity of young clusters which form
through shocking of cold gas.  However, the high-energy emission would be
suppressed in the weak shocks that result from mergers of pre-existing
clusters which contain pre-heated gas, since the energy distribution of the
accelerated electrons is steeper for weak shocks$^8$.  As a cluster relaxes
to hydrostatic equilibrium and ages, its non-thermal luminosity declines.
The emission of hard radiation disappears almost entirely as soon as there
is no strong shocking of gas.  At a perfectly quiescent state of
hydrostatic equilibrium, the non-thermal radiation spectrum cuts-off above
a photon energy, $h\nu \sim 0.5~{\rm keV}(\tau/3\times 10^{9}~{\rm
yr})^{-2}$, for which the electron cooling time equals the cluster age,
$\tau$.  Detection of this cut-off can be used as a method of dating the
time that has passed since the last major accretion episode of cold gas by
the cluster.  Most relaxed clusters with ages $\tau\gg 10^9$ yr, are
expected to show only weak non-thermal emission at $h\nu \ga 10$ keV.  We
note that the detection of nonthermal X-ray emission has been reported
recently for several clusters$^{16,17,29}$.  In addition, some X-ray
clusters possess radio halos$^{30}$ which may result from synchrotron
emission by the residual population of relativistic electrons in the
cluster magnetic field.

\vskip 0.45in
\hrule
\vskip 0.15in
\small
\noindent
\begin{itemize}
\item[1.]  Sreekumar, P. {\it et al.} EGRET observations of the
extragalactic gamma-ray emission. {\it Astrophys. J.} {\bf 494}, 523-534
(1998).  
\v
\item[2.] Chiang, J. \& Mukherjee, R. The luminosity function of the EGRET
gamma-ray blazars. {\it Astrophys. J.} {\bf 496}, 752-760 (1998).
\v
\item[3.] Mukherjee, R. \& Chiang, J. EGRET $\gamma$-ray blazars:
luminosity function and contribution to the extragalactic $\gamma$-ray
background. {\it Astroparticle Phys.} {\bf 11}, 213-215 (1999).  
\v
\item[4.] Cen, R. \& Ostriker, J. P. Where are the baryons?. {\it
Astrophys. J.}  {\bf 514}, 1-6 (1999).
\v
\item[5.] Metzler, C. A. \& Evrard, A. E. A simulation of the intracluster
medium with feedback from cluster galaxies. {\it Astrophys. J.} {\bf 437},
564-583 (1994).
\v
\item[6.] Nevalainen, J., Markevitch, M. \& Forman, W. R.  The cluster M-T
relation from temperature profiles observed with ASCA and ROSAT. {\it
Astrophys. J.}  {\bf in press} (2000); astro-ph/9911369.
\v
\item[7.] Loewenstein, M. Heating of intergalactic gas and cluster scaling
relations.  {\it Astrophys. J.}  {\bf in press} (2000); astro-ph/9910276.
\item[8.] Blandford, R. \& Eichler, D. Particle acceleration at
astrophysical shocks -- a theory of cosmic-ray origin. {\it Phys. Reports}
{\bf 154}, 1-75 (1987).
%\noindent
%5. Axford, W. I., Leer, E., \& Skadron, G. {\it Proc. 15th Int. Conf. Cosmic
%Rays}, Plovdiv, Bulgaria (1977).\\
\v
\item[9.] Bell, A. R. The acceleration of cosmic rays in shock fronts. II.
{\it Mon. Not. R. astr. Soc.} {\bf 182}, 147-156 (1978).
\v
\item[10.] Blandford, R. D., \& Ostriker, J. P. Particle acceleration by
astrophysical shocks. {\it Astrophys. J.} {\bf 221}, L29-L32 (1978).
\v
\item[11.] Koyama, K. {\it et al.} Evidence for shock acceleration of
high-energy electrons in the supernova remnant SN:1006. {\it Nature} {\bf
378}, 255-258 (1995).
\v
\item[12.] Koyama, K. {\it et al.} Discovery of non-thermal x-rays from the
northwest shell of the new SNR RX J1713.7-3946: The Second SN 1006?. {\it
PSAJ} {\bf 49}, L7-L11 (1997).
\v
\item[13.] Tanimori, T. {\it et al.} Discovery of TeV gamma rays from SN
1006: further evidence for the supernova remnant origin of cosmic
rays. {\it Astrophys. J.} {\bf 497}, L25-L28 (1998).
\v
\item[14.] Muraishi, {\it et al.} Evidence for TeV gamma-ray emission from
the shell type SNR RXJ1713.7-3946. {\it Astron. \& Astrophys.}, {\bf in
press} (2000); astro-ph/0001047.
\v
\item[15.] Kronberg, P. Extragalactic magnetic fields.  {\it
Rep. Prog. Phys.} {\bf 57}, 325-382 (1994).
\v
\item[16.] Fusco-Femiano, R. {\it et al.} Hard x-ray radiation in the Coma
cluster spectrum. {\it Astrophys. J.} {\bf 513}, L21-L24 (1999).
\v
\item[17.] Rephaeli, Y., Gruber, D. \& Blanco, P.~ Rossi X-Ray Timing
Explorer observations of the Coma cluster. {\it Astrophys. J.} {\bf 511},
L21-L24 (1999).
\v
\item[18.] Kim, K.-T., Kronberg, P. P., Giovannini, G. \& Venturi, T.
Discovery of intergalactic radio emission in the Coma-A1367
supercluster. {\it Nature} {\bf 341}, 720-723 (1989).
%\noindent
%14. Dreher, J. W., Carilli, C. L. \& Perley, R. A. {\it Astrophys. J.}
%{\bf 316}, 611-625 (1987).\\
%\noindent
%15. Taylor, G. B. \& Perley, R. A. {\it Astrophys. J.}
%{\bf 416}, 554-562 (1993).\\
%\noindent
%16. Ge, J. P. \& Owen, F. N {\it Astron. J.} {\bf 105}, 778-787 (1993);
%{ibid} {\bf 108}, 1523-1533 (1994).\\
\v
\item[19.] Felten, J. E., \& Morrison, P. Omnidirectional inverse Compton
and synchrotron radiation from cosmic distribution of fast electrons and
thermal photons. {\it Astrophys. J.} {\bf 146}, 686-708 (1966).
\v
\item[20.] Tytler, D., O'Meara, J. M., Suzuki, N., \& Lubin, D.  Review of
Big Bang nucleosynthesis and primordial abundances.  {\it Physica Scripta}
{\bf in press} (2000); astro-ph/0001318.
\v
\item[21.] Fukugita, M., Hogan, C. J. \& Peebles, P. J. E. The cosmic
baryon budget. {\it Astrophys. J.}  {\bf 503}, 518-530 (1998).
\v
\item[22.] Primack, J. R., Bullock, J. S., Somerville, R. S. \& McMinn, D.
Probing galaxy formation with TeV gamma ray absorption. {\it Astroparticle
Physics} {\bf 11}, 93-102 (1999).
\v
\item[23.] Konopelko, A. K., Kirk, J. G., Stecker, F. W. \& Mastichiadis,
A.  Evidence for intergalactic absorption in the TeV gamma-ray spectrum
of Markarian 501. {\it Astrophys. J.} {\bf 518}, L13-L15 (1999).  
\v
\item[24.] Coppi, P. S. \& Aharonian, F. A.  Constraints on the very high
energy emissivity of the universe from the diffuse GeV gamma-ray
background. {\it Astrophys. J.} {\bf 487}, L9-L12 (1997).
\v
\item[25.] Mushotzky, R. F., Cowie, L. L., Barger, A. J. \& Arnaud,
K. A. Resolving the extragalactic hard X-ray background. {\it Nature} {\bf
in press} (2000); astro-ph/0002313.
\v
\item[26.] Fabian, A. C. \& Barcons, X. The origin of the X-ray
background. {\it Ann. Rev. of Astron. \& Astrophys.} {\bf 30}, 429-456
(1992).  
\v
\item[27.] Fixsen, D. J. {\it et al.}
%, Cheng, E. S., Gales, J. M., Mather, J. C., Shafer,
%R. A. \&  Wright, E. L. 
The cosmic microwave background spectrum from the full COBE FIRAS data set.
{\it Astrophys. J.} {\bf 473}, 576-587 (1996).
\v
\item[28.] Hasinger, G. {\it et al.} The ROSAT deep survey. I. X-ray
sources in the Lockman field.
%Burg, R., Giacconi, R., Schmidt, M., Trumper, J. \& Zamorani, G. 
{\it Astron. \& Astrophys.} {\bf 329}, 482-494 (1998).
%\noindent
%26.  Berghoefer, T. W., Bowyer, S., \& Korpela, E. {\it Astrophys.
%J.} {\bf in press} (2000); astro-ph/9912421.\\
%%26. Lieu, R., Bonamente, M. \& Mittaz, J. P. D. {\it Astrophys. J.}
%%{\bf 517}, L91-L95 (1999).\\
%\noindent
%27. Sarazin, C. L. \& Lieu, R. {\it Astrophys. J.} {\bf 494}, L177-L180
%(1998).\\
%\noindent
\v
\item[29.] Kaastra, J. S. High and low energy nonthermal x-ray 
emission from the Abell 2199 cluster of galaxies. {\it et al.} 
{\it Astrophys. J.} {\bf 519}, L119-L122 (1999).
\v
\item[30.] Deiss, B. M., Reich, W., Lesch, H. \& Wielebinsi, R.  The
large-scale structure of the diffuse radio halo of the Coma cluster at
1.4GHz. {\it Astron. \& Astrophys.} {\bf 321}, 55-63 (1997).
\end{itemize}

\normalsize
\vskip 0.2in
\noindent
{ACKNOWLEDGEMENTS.} This work was supported in part by the Israel-US BSF
and by NSF. AL thanks the Weizmann Institute for its kind hospitality
during the course of this work. EW is the incumbent of the Beracha
foundation career development chair.


\newpage

\begin{figure}
\centerline{\psfig{figure=fig1.ps,width=6in}}
\caption{Spectrum of the unresolved $\gamma$-ray background.  Points with
error bars are the observed data from EGRET$^1$. The lower shaded region
shows the expected contribution from unresolved point sources, based on
empirical modeling of the luminosity function of blazars$^{2,3}$. The solid
line shows the diffuse emission from intergalactic shocks, according to
Eq.~(1) with $\xi_e=0.05$ and $f_{\rm sh}kT=1$ keV. The upper shaded region
shows the sum of these contributions, which provides an excellent fit to
the data. The blazar contribution was calibrated$^{2,3}$ only by the total
flux in photons with energies $E>10^5$ keV; hence, the small deviations of
some data points from the upper shaded region might be due to uncertainties
in the cumulative blazar spectrum.  Although the background flux predicted
by Eq.~(1) is independent of the magnetic field strength in the
intergalactic shocks, the maximum energy of scattered photons does depend
on the field strength and is given by, $h\nu_{\rm max}\sim
1.2~B_{-7}(kT/{\rm keV})~{\rm TeV}$.  Photons with energies $\ga 1$ TeV
produce an electron-positron pair as they scatter on the infrared
background$^{22,23}$. The pair cools again by scattering microwave photons,
which may in turn produce new pairs.  The energy originally stored in
photons with $h\nu\ga {\rm TeV}$ is spread smoothly over the 100 MeV to TeV
energy range$^{24}$, and might raise the existing flux there. However,
since in our model only a small fraction of the electrons are accelerated
to the energy required for the production of $h\nu\ga {\rm TeV}$ photons,
we expect this effect to be small.  }
\label{fig1}
\end{figure}

\end{document}











psfig.tex
% Psfig/TeX 
\def\PsfigVersion{1.9}
% 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. Changed to avoid problems
% with amstex per suggestion by jbence@math.ucla.edu

\let\LaTeXAtSign=\@
\let\@=\relax
\edef\psfigRestoreAt{\catcode`\@=\number\catcode`@\relax}
%\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 \PsfigVersion}

%% 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\psletter = 11 % won't conflict with \begin{letter} now...
\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 `\@ = \psletter
	\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 sp{
		% 1/92 TJD Changed from "true sp" to "sp" for magnification.
			\hbox to \@p@srwidth 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 sp{
			\vss
			\hbox to \@p@srwidth sp{ \hss \@p@sfile \hss }
			\vss
			}}}
		}\else{
			% Non-verbose draft
			\vbox to \@p@srheight sp{
			\vss
			\hbox to \@p@srwidth sp{\hss}
			\vss
			}
		}\fi	



	}\fi
}}
\psfigRestoreAt
\let\@=\LaTeXAtSign
