%====================================================================%
%                  SPROCL.TEX     27-Feb-1995                        %
% This latex file rewritten from various sources for use in the      %
% preparation of the standard proceedings Volume, latest version     %
% by Susan Hezlet with acknowledgments to Lukas Nellen.              %
% Some changes are due to David Cassel.                              %
%====================================================================%

\documentstyle[sprocl]{article}

\input{psfig}
\bibliographystyle{unsrt}    % for BibTeX - sorted numerical labels by order of
                             % first citation.

% A useful Journal macro
\def\Journal#1#2#3#4{{#1} {\bf #2}, #3 (#4)}

% Some useful journal names
\def\NCA{\em Nuovo Cimento}
\def\NIM{\em Nucl. Instrum. Methods}
\def\NIMA{{\em Nucl. Instrum. Methods} A}
\def\NPB{{\em Nucl. Phys.} B}
\def\PLB{{\em Phys. Lett.}  B}
\def\PRL{\em Phys. Rev. Lett.}
\def\PRD{{\em Phys. Rev.} D}
\def\ZPC{{\em Z. Phys.} C}
% Some other macros used in the sample text
\def\st{\scriptstyle}
\def\sst{\scriptscriptstyle}
\def\mco{\multicolumn}
\def\epp{\epsilon^{\prime}}
\def\vep{\varepsilon}
\def\ra{\rightarrow}
\def\ppg{\pi^+\pi^-\gamma}
\def\vp{{\bf p}}
\def\ko{K^0}
\def\kb{\bar{K^0}}
\def\al{\alpha}
\def\ab{\bar{\alpha}}
\def\be{\begin{equation}}
\def\ee{\end{equation}}
\def\bea{\begin{eqnarray}}
\def\eea{\end{eqnarray}}
\def\CPbar{\hbox{{\rm CP}\hskip-1.80em{/}}}%temp replacement due to no font

\newcommand{\z}{&&\hspace*{-1cm}}
\def \as {\alpha_s}
\def \gl {\tilde{g}}
\def \ms {{\overline{\mbox{MS}}}}
\def \dr {{\overline{\mbox{DR}}}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                %
%    BEGINNING OF TEXT                           %
%                                                %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}

\title{QCD RELATIONS BETWEEN STRUCTURE FUNCTIONS AT SMALL X}

\author{ A.C. Kotikov}

\address{
Particle Physics Laboratory\\ Joint Institute for Nuclear Research\\
141980 Dubna (Moscow Region), Russia}

\author{ G. Parente }

\address{Departamento de F\'\i sica de Part\'\i culas \\
Universidade de Santiago de Compostela\\
15706 Santiago de Compostela, Spain}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% You may repeat \author \address as often as necessary      %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\maketitle\abstracts{
We present very simple non-integral relations between deep inelastic
structure functions $F_L$, $F_2$ and the gluon distribution
at small $x$ based on perturbative QCD which are useful for
the phenomenological analysis of data at low $x$.
As an application we extract the deep inelastic scattering cross-sections
ratio $R= \sigma _L/\sigma _T$
in the range $10^{-4} \leq x \leq  10^{-2}$
from $F_2$ HERA data.
}


\section{Introduction}

For experimental studies of high energy hadron-hadron and lepton-hadron
processes it is necessary to know in detail the
values of the parton (quark and gluon) distributions
(PD) of nucleons, especially at small values of $x$. 
Of great relevance is the
determination of the gluon density at low x, where gluons
are expected to be dominant.

The basic
information on the gluon
structure of nucleons is extracted from the measurement of
the deep inelastic structure function $F_2$ in
lepton-hadron scattering (DIS). One of the usual procedures
compares experimental data with the theoretical
prediction for $F_2$ obtained from the solution of a system
of complicated
coupled integro-differential quark and gluon evolution equations.
It is also possible to extract the gluon distribution more directly
from $F_2$ scaling violations using
a very simple relation with the $Q^2$ derivative of $F_2$
\cite{PRYTZ}$^{\!-\,}$\cite{DUCATI}.


By other part, $F_L$ or the ratio $R=F_L/(F_2 - F_L)$, 
is also an interesting quantity, because it is a very sensitive QCD
characteristic.
For examplle, future $F_L$ measurements \footnote{At present there
are only preliminary measurements by H1 \cite{H1FL}},
will be used as a signal of the gluon structure at low 
$x$ \cite{COOPER}.

In perturbative QCD, there is the possibility to connect
$F_L$ with $F_2$ due to the fact that at small $x$
the DIS structure functions depend really on only
two {\it independent} functions,
the gluon and the singlet quark distribution (the nonsinglet quark
density is negligible at small $x$), which in turn
can be expressed in terms of $F_2$ and its derivative
$dF_2/dlnQ^2$.

In this article
we present very simple linear relations \footnote{Some of them 
have been already published \cite{KOPA,KOPAFL,KOPAR,KOTIJETP95}.} 
between the gluon density and $F_L(x,Q^2)$ with $F_2(x,Q^2)$
and $dF_2(x,Q^2)/dlnQ^2$ at small $x$. 
Using these formulas we exploit the possibility of extracting information
about the gluon distribution and $F_L$ at small $x$,
directly from the measurement of the $F_2$ scaling violations.
This method complement the standard analysis where quarks
and gluons, determined from complex fits to data,
are integrated for the calculation of $F_L$. With our formulas
it is possible to take into account the experimental uncertainty in
the theoretical calculation more directly.

The standard intial form for
the singlet quark
$s(x,Q^2_0)$ and gluon $g(x,Q^2_0)$ distributions  
\footnote{We use PD multiplied by $x$
 and neglect the nonsinglet quark distribution at small $x$.}
at some $Q^2_0$ are parameterized by \cite{4}:
\begin{eqnarray} 
p(x,Q^2_0) & = & A_p
x^{-\delta_p} (1-x)^{\nu_p} (1+\epsilon_p \sqrt{x} + \gamma_p x)
~~~~(p=S,g)
\label{1} 
\end{eqnarray}
Until the recent time the value of $\delta_p$
was a matter of discussion \cite{9}$^{\!-\,}$\cite{7},
but the new HERA data
\cite{F2H1,ZEUSGLU95} start to overcome this controversy.  
From the theoretical side, the type of evolution of the PD
in Eq. \ref{1} depends on the value and form of
$\delta_p$. For example \cite{Mar,KOTIYF93,EKL}, a $Q^2$-independent
$\delta_S = \delta_g$ obey the
DGLAP equation  when $x^{-\delta_p} \gg 1$. However, if $\delta_p (Q^2_0) =0$
in some point $Q^2_0 \geq 1 GeV^2$, the behaviour $p(x,Q^2) \sim Const$
is not compatible with DGLAP evolution and a more singular
behaviour is generated \cite{7,BF,KOTILOWX}.
These cases have been recently evolved to a common picture \cite{KOTILOWX}  
where partons are really a combination of
two solutions (at $x^{-\delta_p} \gg 1$ and at $\delta_p \sim 0$) linked
at some $Q^2$ point. For a Regge-like
form of structure functions, one obtains \cite{KOTILOWX}
$ p(x,Q^2) \sim x^{-\overline \delta_p(Q^2)} $
with next-to-leading order (NLO) $\overline \delta_S(Q^2) \neq
\overline \delta_g(Q^2)$ intercept trajectories.
 Without any restrictions, it generates the double-logarithmical behaviour,
\begin{eqnarray}
 p(x,Q^2) \sim \exp{\biggl(2
   \sqrt{\overline \delta_p(Q^2)ln\frac{1}{x}}\biggr)}  
\label{2} \end{eqnarray}
where at NLO and for $f=4$ active quarks one has \cite{KOTILOWX}:
$$\overline \delta_g(Q^2)~=~ \frac{36}{25} t -\frac{91096}{5625} r,~~
\overline \delta_S(Q^2)~=~\overline \delta_g(Q^2)  -20 r$$
being $t~=~ln(\alpha(Q^2_0)/\alpha(Q^2))$ and $r~=~
\alpha(Q^2_0) - \alpha(Q^2)$ \footnote{Hereafter
we use $ \alpha(Q^2)= \alpha_s(Q^2)/{4 \pi}$.
Sometimes it is denoted as $ \alpha $ to shorten long formulae.}.

\section{The gluon and $F_L$ as a function of $F_2$ and
$dF_2/dlnQ^2$}

By lack of space we will only present the final
formulas of the calculation while the details will be given
elsewhere \cite{INPREP}. 
Assuming the {\it Regge-like behaviour} of Eq. \ref{1} for
$x^{-\delta_p} \gg 1$, one can replace at small $x$
the convolution integrals
by ordinary products in 
the $Q^2$ evolution equations and in
the formulas relating $F_2$ and $F_L$ to PD. 
From the $F_2$ equation one can extract the
singlet quark combination $S(x,Q^2)$
as a function of $F_2(x,Q^2)$ and $g(x,Q^2)$ and substitute
it into the equations for $F_L$ and for $dF_2/dlnQ^2$. 

The case of the non-Regge type behaviour has to be treated independently,
but it is possible to combine both cases (Regge and non-Regge types)
in a single formula valid for any value of $\delta_p$:
\begin{eqnarray} \z
g(x, Q^2)  = - \frac{2f}{\alpha e}
\frac{ 1}{ \gamma^{(0),1+\delta_g}_{sg} + 
\tilde \gamma^{(1),1+\delta_g}_{sg} \alpha }  \biggl[ 
\frac{d F_2(x, Q^2)}{dlnQ^2} 
+ \frac{\alpha }{2} 
 \gamma^{(0),1+\delta_S}_{ss} 
F_2(x,Q^2) \nonumber \\ \z
~~~~~~~~~~~~ ~+~ O(\alpha^2, x^{1-\delta})  \biggr],  
\label{14.9}  \\
\z  F_L(x, Q^2)  = 
\alpha 
  B^{S,\delta_S}_{L} 
F_2(x,Q^2)- 2 
\frac{B^{g,1+\delta_g}_L \Bigl(1+ \alpha \tilde R^{g,1+\delta_g}_L \Bigr)}{ 
\gamma^{(0),1+\delta_g}_{Sg} + 
\tilde \gamma^{(1),1+\delta_g}_{Sg} \alpha } 
\biggl[
\frac{d F_2(x, Q^2)}{dlnQ^2} \nonumber \\ \z
~~~~~~~~~~~~ ~+~ \frac{\alpha }{2}  
 F_2(x,Q^2) \biggr]
+
O(\alpha^2, x^{1-\delta_p}), 
\label{15.1} 
\end{eqnarray}
where $e = \sum_i^f e^2_i$ is the sum of squares of $f$ quark charges.
The variables $B^{l,\eta}_k$ ($k=2,L$) and $\gamma^{(0),\eta}_{pl}$ 
$(p,l=g,S)$
are respectively the one loop parts of the Wilson coefficients and anomalous
dimensions of the operators. The second order quantities
are related to the two loop
Wilson coefficients and anomalous dimensions by:
\begin{eqnarray} \z
\overline R^{g}_{L} ~=~  R^{g,1+\delta_g}_{L} - B_2^{g,1+\delta_g}
 B^{S,1+\delta_S}_{L} / B^{g,1+\delta_g}_{L},  \nonumber \\ \z
\overline    \gamma^{(1)}_{Sg} ~=~
   \gamma^{(1),1+\delta_g}_{Sg} + B_2^{S,\delta_S} 
\gamma^{(0),1+\delta_g}_{Sg} + B_2^{g,1+\delta_g} \bigl(2\beta_0 + 
  \gamma^{(0),1+\delta_g}_{gg} - \gamma^{(0),1+\delta_S}_{SS} \bigr)
 \nonumber  
 \end{eqnarray} 

All these coefficients have to be continued analytically from the
well known integer values $n$ to the non-integer ones $\eta$.

The values of
$\tilde \gamma^{(1)}_{Sg}$ and $\tilde R^{g}_{L}$
 coincide with $\overline \gamma^{(1)}_{Sg}$ and 
$\overline R^{g}_{L}$, respectively, with the replacement,
\begin{eqnarray}
\frac{1}{\delta_g} \to \int^1_x \frac{dy}{y}~ \frac{g(y,Q^2)}{g(x,Q^2)} 
\label{14.1} 
\end{eqnarray}
In the cases $x^{-\delta_g} \gg Const$ and $\delta_g \to 0$, the r.h.s. of 
Eq. \ref{14.1} leads to $1/\delta_g $ and $1/\tilde \delta_g $,
respectively, where
\begin{eqnarray}
\frac{1}{\tilde \delta_p} = 
\sqrt{\frac{ln(1/x)}{\overline \delta_p(Q^2)}} 
- \frac{1}{4\overline \delta_p(Q^2)} 
\biggl[1+
\frac{1}{8\sqrt{4\overline \delta_p(Q^2)\ln(1/x)}} +
 O\Bigl(\frac{1}{4\overline \delta_p\ln(1/x)} \Bigr) \biggr]
\! \label{14} 
\end{eqnarray}
The comparison of our results with others is performed elsewhere
\cite{INPREP}.

\section{The extraction of the ratio $R$ at low $x$} \indent

As an application we have extracted
the ratio $R(x,Q^2)$ from H1 1994
data \cite{F2H1}, determining the slopes dF$_2$/dlnQ$^2$
from straight line fits \cite{H1PREP95,ZEUSGLU95}.
The systematic errors have been taken from an early
analysis of H1 \cite{H1PREP95}.
The running coupling constant
$\alpha_s(Q^2)$ has been calculated at two loops using
$\Lambda^{(4)}(\ms)=225 MeV$.
 
Figure 1 shows the extracted ratio $R$ at
$Q^2 = 20$ GeV$^2$ for $\delta_S=0.3$ and  
two different exponent for the gluon,
$\delta_g = \delta_S$ and 
 $\delta_g = \delta_S +0.05$.
These values are very close to those obtained
by various groups from QCD fits to H1 data \cite{F2H1,MRS96}.
Fig. 1 also shows some experimental data points \cite{FLDATA}
at high $x$.
\begin{figure}
%\rule{5cm}{0.2mm}\hfill\rule{5cm}{0.2mm}
%\vskip 6.cm
%\rule{5cm}{0.2mm}\hfill\rule{5cm}{0.2mm}
\psfig{figure=figu.eps,height=6cm,width=10cm}
\caption{The ratio $R$ extracted from H1 data. The lines are the
predictions from different models (see text). The band represent
the uncertainty from a DGLAP analysis of HERA data}
\end{figure}
For comparison we have also plotted various predictions for $R$ using
QCD formulae at O($\alpha_s^2$)
\footnote{The quark singlet and non-singlet kernels in $\ms$ scheme
are taken from
ref. \cite{FLNLO}. It was noted in \cite{LARINVERMASEREN}
that the gluon kernel given in \cite{FLNLO} is erroneous.
We use the correct result given in \cite{VANNEERVEN} and \cite{KAKO}.}
and parton densities extracted from fits to HERA data.
The large difference between the result from MRS(G) and the latest
set MRS(R1) \cite{MRS96} shows the sensitivity of R
to the update of these parton densities to new HERA data.
One can notice that 
there is good agreement between MRS(R1) prediction and our points when
$\delta_g = \delta_S +0.05 =0.35$, even though it is not surprising
because these values were taken from the MRS analysis 
\cite{MRS96}. However our result gives extra information about
the uncertainty.
A more precise future measurements at low $x$
should lie within the error bars of the results presented in Fig. 1. 

By other part recent theoretical predictions
on $R$ based on conventional NLO DGLAP evolution analysis of HERA data
(LBY) \cite{LBY} and on the dipole picture of BFKL dynamics
(NPRW) \cite{NPRW}, both finding values $\delta_S \equiv \delta_g
\approx 0.3$, lie between the two of our above cases.
%
%------------   FIN -------------
%
\section*{Acknowledgments}

This work was partially supported by CICYT (AEN96-1773), by
Xunta de Galicia (XUGA-20604A96), and by RFFR (95-02-04314-a).

\section*{References}
\begin{thebibliography}{99}

%
\bibitem{PRYTZ}  K. Prytz, 
{\em Phys. Lett.} B{\bf 311}, 286 (1993); B{\bf 332}, 393 (1994).
%
\bibitem{EKL}
R.K.~Ellis, Z.~Kunszt and E.M.~Levin, {\em Nucl. Phys.} B{\bf 420} 517
(1994). 
%
\bibitem{KOTIJETP95}
A.V.~Kotikov, {\em JETP Lett.} {\bf 59}, 667 (1995); 
{\em JETP} {\bf 80}, 979 (1995).
%
\bibitem{KOPA} A.V. Kotikov and G. Parente, {\em Phys. Lett.} B{\bf 379},
195 (1996). 
%preprint ENSLAPP-A-573/95,
%US-FT-29-95  ; .
%
\bibitem{DUCATI} M.B. Gay Ducati and V.P.B. Gon\c{c}alves,
\PLB {\bf 390}, 401 (1997).
%
\bibitem{H1FL} C. Adloff et al., H1 Collaboration,
\PLB {\bf 393}, 452 (1997). F. Zomer, Talk given at this Workshop.
%
\bibitem{COOPER}
A.M. Cooper-Sarkar et al.,
%, G. Ingelman, K.R. Long, R.G. Roberts and D.H. Saxon,
 {\em Z. Phys.} C {\bf 39}, 281 (1988);
M.W. Krasny et al.,  \ZPC {\bf 53}, 687 (1992);
L. Favart et al., \ZPC {\bf 72}, 425 (1996).
%
\bibitem{KOPAFL} A.V. Kotikov and G. Parente,
{\em Mod. Phys. Lett.} A{\bf 12},
963 (1997).
%
\bibitem{KOPAR} A.V. Kotikov and G. Parente, {\em JETP} {\bf 85}, 17
(1997).
%
\bibitem{4}  A.D. Martin, W.S. Stirling and R.G. Roberts,
{\em Phys. Lett.} B{\bf 306}, 145 (1993); {\em Phys. Lett.} B{\bf 354},
155 (1995).
%
\bibitem{9} E.A. Kuraev, L.N. Lipatov, and V.S. Fadin, ZHETF {\bf 53},
2018 (1976), {\bf 54}, 128 (1977); 
Ya.Ya. Balitzki and L.N. Lipatov, Yad. Fiz. {\bf 28}, 822 (1978);
L.N. Lipatov, ZHETF {\bf 63}, 904 (1986);
%
\bibitem{68}
A. Donnachie and P.V. Landshoff, \NPB {\bf 244}, 322
 (1984); {\bf 267}, 690 (1986); P.V. Landshoff and O. Nachmann,
 \ZPC {\bf 35}, 405 (1987).
%
\bibitem{7} P. Amaudruz
 et al, NMC Collab., \PLB {\bf 295}, 159 (1992);
M. Arneodo et al., NMC Collab., \PLB {\bf 364}, 207 (1995).
%
\bibitem{F2H1}
T. Ahmed et al., H1 Collaboration, \NPB {\bf 439}, 471 (1995). 
%
\bibitem{ZEUSGLU95}
M. Derrick et al., ZEUS Collaboration, \PLB {\bf 345}, 576 (1995).
%
\bibitem{Mar}
F.~Martin, \PRD {\bf 19}, 1382 (1979);
C.~L\'opez and F.J.~Yndur\'ain, \NPB {\bf 171}, 231 (1980); 
V.I.~Vovk, A.V.~Kotikov and S.J.~Maximov, {\em Teor. Mat. Fiz.} {\bf
  84}, 101 (1990).
%
\bibitem{KOTIYF93}
A.V.~Kotikov, {\em Yad. Fiz.} {\bf 56}, 217 (1993).
%
\bibitem{BF}  R.D. Ball and S. Forte, 
\PLB {\bf 336}, 77 (1994); {\bf 335}, 77 (1994).
%
\bibitem{KOTILOWX} A.V. Kotikov, {\em Mod. Phys. Lett.} A{\bf 11},
103 (1996); {\em Yad. Fiz.} {\bf 59}, 2219 (1996).
%
\bibitem{INPREP} A.V. Kotikov and G. Parente, Preprint in preparation.
%
\bibitem{H1PREP95}
T. Aid et al., H1 Collaboration,  \PLB {\bf 354}, 494 (1995).
%
\bibitem{MRS96}  A.D. Martin, R.G. Roberts and W.S. Stirling,
\PLB {\bf 387},419 (1996).
%
\bibitem{FLDATA}
A.C. Benvenuti et al., BCDMS Collaboration, \PLB {\bf 237}, 592 (1990);
 M. Arneodo et al., NM Collab., \NPB  {\bf 483}, 3 (1997);
A. Bodek et al., CCFR/NuTeV Collab., {\it J. Phys.} {\bf 22}, 775 (1996).
%H. Abramowitz, {\it ``Test of QCD at low $x$''}, 
%talk given at the EPS Conference, Warsaw 1996.
%
\bibitem{LARINVERMASEREN}
S. Larin and J. Vermaseren, \ZPC {\bf 57}, 93 (1993).
%
\bibitem{FLNLO}
J. S\'anchez Guill\'en et al.,
%, J.L. Miramontes, M. Miramontes, G. Parente and O.A. Sampayo, 
\NPB {\bf 353}, 337 (1991).
%
\bibitem{VANNEERVEN}
E.B. Zijlstra and W.L. van Neerven, \NPB {\bf 383}, 525 (1992).
%
\bibitem{KAKO}
D.I. Kazakov and A.V. Kotikov, \PLB {\bf 291}, 171 (1992).
%
\bibitem{LBY} C. L\'opez, F. Barreiro and F.J. Yndur\'ain, \ZPC {\bf 72},
561 (1996); K. Adel, F. Barreiro and F.J. Yndur\'ain,
\NPB {\bf 495}, 221 (1997) 221.
%
\bibitem{NPRW} H. Navelet et al., \PLB {\bf 385}, 357 (1996).
%
\end{thebibliography}

\end{document}

%%%%%%%%%%%%%%%%%%%%%%
% End of sprocl.tex  %
%%%%%%%%%%%%%%%%%%%%%%


% Psfig/TeX Release 1.2
% dvips version
%
% All software, documentation, and related files in this distribution of
% psfig/tex are Copyright 1987, 1988 Trevor J. Darrell
%
% Permission is granted for use and non-profit distribution of psfig/tex 
% providing that this notice be clearly maintained, but the right to
% distribute any portion of psfig/tex for profit or as part of any commercial
% product is specifically reserved for the author.
%
% $Header: psfig.tex,v 1.9 88/01/08 17:42:01 trevor Exp $
% $Source: $
%
% Thanks to Greg Hager (GDH) and Ned Batchelder for their contributions
% to this project.
%
\catcode`\@=11\relax
\newwrite\@unused
\def\typeout#1{{\let\protect\string\immediate\write\@unused{#1}}}
\typeout{psfig/tex 1.2-dvips}


%% 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}}
% 
%
\def\psdraft{
	\def\@psdraft{0}
	%\typeout{draft level now is \@psdraft \space . }
}
\def\psfull{
	\def\@psdraft{100}
	%\typeout{draft level now is \@psdraft \space . }
}
\psfull
\newif\if@prologfile
\newif\if@postlogfile
\newif\if@noisy
\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@clip
\newif\if@verbose
\def\@p@@sclip#1{\@cliptrue}

%%% GDH 7/26/87 -- changed so that it first looks in the local directory,
%%% then in a specified global directory for the ps file.

\def\@p@@sfile#1{\def\@p@sfile{null}%
	        \openin1=#1
		\ifeof1\closein1%
		       \openin1=\figurepath#1
			\ifeof1\typeout{Error, File #1 not found}
			\else\closein1
			    \edef\@p@sfile{\figurepath#1}%
                        \fi%
		 \else\closein1%
		       \def\@p@sfile{#1}%
		 \fi}
\def\@p@@sfigure#1{\def\@p@sfile{null}%
	        \openin1=#1
		\ifeof1\closein1%
		       \openin1=\figurepath#1
			\ifeof1\typeout{Error, File #1 not found}
			\else\closein1
			    \def\@p@sfile{\figurepath#1}%
                        \fi%
		 \else\closein1%
		       \def\@p@sfile{#1}%
		 \fi}

\def\@p@@sbbllx#1{
		%\typeout{bbllx is #1}
		\@bbllxtrue
		\dimen100=#1
		\edef\@p@sbbllx{\number\dimen100}
}
\def\@p@@sbblly#1{
		%\typeout{bblly is #1}
		\@bbllytrue
		\dimen100=#1
		\edef\@p@sbblly{\number\dimen100}
}
\def\@p@@sbburx#1{
		%\typeout{bburx is #1}
		\@bburxtrue
		\dimen100=#1
		\edef\@p@sbburx{\number\dimen100}
}
\def\@p@@sbbury#1{
		%\typeout{bbury is #1}
		\@bburytrue
		\dimen100=#1
		\edef\@p@sbbury{\number\dimen100}
}
\def\@p@@sheight#1{
		\@heighttrue
		\dimen100=#1
   		\edef\@p@sheight{\number\dimen100}
		%\typeout{Height is \@p@sheight}
}
\def\@p@@swidth#1{
		%\typeout{Width is #1}
		\@widthtrue
		\dimen100=#1
		\edef\@p@swidth{\number\dimen100}
}
\def\@p@@srheight#1{
		%\typeout{Reserved height is #1}
		\@rheighttrue
		\dimen100=#1
		\edef\@p@srheight{\number\dimen100}
}
\def\@p@@srwidth#1{
		%\typeout{Reserved width is #1}
		\@rwidthtrue
		\dimen100=#1
		\edef\@p@srwidth{\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@sfile{}
		\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
\newif\ifnot@eof
\newread\ps@stream
\def\bb@missing{
	\if@verbose{
		\typeout{psfig: searching \@p@sfile \space  for bounding box}
	}\fi
	\openin\ps@stream=\@p@sfile
	\no@bbtrue
	\not@eoftrue
	\catcode`\%=12
	\loop
		\read\ps@stream to \line@in
		\global\toks200=\expandafter{\line@in}
		\ifeof\ps@stream \not@eoffalse \fi
		%\typeout{ looking at :: \the\toks200 }
		\@bbtest{\toks200}
		\if@bbmatch\not@eoffalse\expandafter\bb@cull\the\toks200\fi
	\ifnot@eof \repeat
	\catcode`\%=14
}	
\catcode`\%=12
\newif\if@bbmatch
\def\@bbtest#1{\expandafter\@a@\the#1%%BoundingBox:\@bbtest\@a@}
\long\def\@a@#1%%BoundingBox:#2#3\@a@{\ifx\@bbtest#2\@bbmatchfalse\else\@bbmatchtrue\fi}
\long\def\bb@cull#1 #2 #3 #4 #5 {
	\dimen100=#2 bp\edef\@p@sbbllx{\number\dimen100}
	\dimen100=#3 bp\edef\@p@sbblly{\number\dimen100}
	\dimen100=#4 bp\edef\@p@sbburx{\number\dimen100}
	\dimen100=#5 bp\edef\@p@sbbury{\number\dimen100}
	\no@bbfalse
}
\catcode`\%=14
%
\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 \typeout{FATAL ERROR: no bb supplied or found}
			\no-bb-error
		\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}
		%\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}
		%\typeout{ \@p@sheight * \@bbw / \@bbh, = \@result }
		\edef\@p@swidth{\@result}
		%\typeout{w from h: width is \@p@swidth}
}
\def\compute@hfromw{
		% computing : height = width * (bbh / bbw)
		\in@hundreds{\@p@swidth}{\@bbh}{\@bbw}
		%\typeout{ \@p@swidth * \@bbh / \@bbw = \@result }
		\edef\@p@sheight{\@result}
		%\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
}
%		
% Compute any missing values
\def\compute@sizes{
	\compute@bb
	\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{
		\if@verbose{
			\typeout{psfig: including \@p@sfile \space }
		}\fi
		%
		\special{ps::[begin] 	\@p@swidth \space \@p@sheight \space
				\@p@sbbllx \space \@p@sbblly \space
				\@p@sbburx \space \@p@sbbury \space
				startTexFig \space }
		\if@clip{
			\if@verbose{
				\typeout{(clip)}
			}\fi
			\special{ps:: doclip \space }
		}\fi
		\if@prologfile
		    \special{ps: plotfile \@prologfileval \space } \fi
		\special{ps: plotfile \@p@sfile \space }
		\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.
		\vbox to \@p@srheight true sp{
		\vss
			\hbox to \@p@srwidth true sp{
				\hss
				\if@verbose{
					\@p@sfile
				}\fi
				\hss
			}
		\vss
		}
	}\fi
}}
\def\psglobal{\typeout{psfig: PSGLOBAL is OBSOLETE; use psprint -m instead}}
\catcode`\@=12\relax


