%%
%% This is file `cpc-hepnp.cls',
%% 
%% Copyright (c) 2007 Chinese Physics C
%% http://cpc-hepnp.ihep.ac.cn
%% mailto:hepnp@ihep.ac.cn

%------------------------------------------------------------------------------------------------------

\NeedsTeXFormat{LaTeX2e}[1996/12/01]
\ProvidesClass{cpc-hepnp}
\def\class@name{cpc-hepnp}%

\NeedsTeXFormat{LaTeX2e}
   \@obsoletefile{article.cls}{article.sty}
   \LoadClass{article}

\RequirePackage{fancyhdr}
\RequirePackage[numbers,sort&compress]{natbib}

\DeclareMathSizes{10}{10}{6}{5}  

%гнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгнгн

\setlength{\textheight}{242mm}
\setlength{\textwidth}{169mm}
\setlength{\topmargin}{-0.3in}  
\leftmargin 0mm
\evensidemargin 0mm
\headheight 12mm               
\headsep 5mm                  
\footskip 11pt                   
\oddsidemargin-8mm             
\evensidemargin-8mm            
\columnsep 7mm               

%--------------------------------------------------------------------------------------------------------------

\renewcommand{\baselinestretch}{1.1}  
\renewcommand{\arraystretch}{1.2}

\setlength{\parskip}{0pt}       
\setlength{\floatsep}{6pt}         
\setlength{\textfloatsep}{6pt}    
\setlength\footnotesep{8pt}        

\setlength{\abovecaptionskip}{4pt plus1pt minus1pt}
\setlength{\belowcaptionskip}{4pt plus1pt minus1pt} 
\setlength{\abovedisplayskip}{6pt plus1pt minus1pt}
\setlength{\belowdisplayskip}{6pt plus1pt minus1pt} 
\addtolength{\thinmuskip}{-1mu}         
\addtolength{\medmuskip}{-2mu}      
\addtolength{\thickmuskip}{-2mu}      


%---------------------------------------------------------------------------------------------------

\font\scten=euex10 at 10pt
\newcommand{\vint}{\mathop{{\vcenter{\hbox{\scten\char90}}}}}
\renewcommand{\int}{\vint}

\font\sctenr=euex10 at 9pt
\newcommand{\sint}{\mathop{{\vcenter{\hbox{\sctenr\char82}}}}} 

\font\timeroman=psyr at 10pt
\newcommand{\vpartial}{\mathop{{\hbox{\timeroman \char182}}}} 


%---------------------------------------------------------------------------------------------------

\def\journal#1#2#3#4#5{{#1}. {#2}, {#3}, {\bf #4}: {#5}}
\def\book#1#2#3#4#5#6{{#1}. {#2}. {#3}: {#4}, {#5}. {#6}}
\def\diss#1#2#3#4#5#6#7{{#1}. {#2}. {#3}. {#4}: {#5}, {#6}. {#7}}

\newcommand{\thanksmark}{\textsuperscript{\,\rm{*}}}   


\newcommand{\ruleup}{\vspace*{-0.5cm}\noindent\rule{8.35cm}{0.2pt}\rule{0.6pt}{0.4cm}\vspace*{0.2cm}}
\newcommand{\ruledown}{\vspace*{-0.5cm}\hfill\noindent{\vspace*{-0.2cm}\lower.38cm\hbox{\rule{0.2pt}{0.4cm}}\rule{8.35cm}
              {0.2pt}}\vspace*{-3.5mm}}

\newcommand{\wen}[1]{\raisebox{0.3mm}{\textsuperscript{[#1]}}} 

\newcommand{\bb}{\raisebox{0.4mm}[0pt]{:}}


%----------------------------------\thanks, \footnote--------------------------------------

\makeatletter

\renewcommand{\thefootnote}{\fnsymbol{footnote}}  

\renewcommand{\thanks}[1]{\thanksmark
    \protected@xdef\@thanks{\@thanks
        \protect\footnotetext[0]{\hspace*{-6pt}$*$\;#1}}}

\newcounter{email}            
\setcounter{email}{1}
\newcommand{\email}[1]{%
    \protected@xdef\@thanks{\@thanks%
        \protect\footnotetext[0]{\hspace*{-8pt}\arabic{email})\,{E-mail:\,}#1}}%
        \stepcounter{email}}%



\renewcommand\footnoterule{%
  \kern 1\p@
  \hrule \@width37mm
  \kern 8\p@}

\renewcommand\@makefntext[1]{%
    \parindent 1em%
    \noindent
    \hb@xt@2em{\hss\@makefnmark}#1}

%---------------------------------------------------------------------------------------

\renewcommand\maketitle{\par%
  \begingroup
    \renewcommand\thefootnote{\@fnsymbol\c@footnote}%
    \def\@makefnmark{\rlap{\@textsuperscript{\normalfont\@thefnmark}}}%
    \long\def\@makefntext##1{\parindent 1em\noindent
            \hb@xt@2em{%
                \hss\@textsuperscript{\normalfont\@thefnmark}}##1}%
    \if@twocolumn
      \ifnum \col@number=\@ne
        \@maketitle
      \else
        \twocolumn[\@maketitle]%
      \fi
    \else
      \newpage
      \global\@topnum\z@   % Prevents figures from going at top of page.
      \@maketitle
    \fi
  \@thanks
  \endgroup
  \setcounter{footnote}{0}%
  \global\let\thanks\relax
  \global\let\maketitle\relax
  \global\let\@maketitle\relax
  \global\let\@thanks\@empty
  \global\let\@author\@empty
  \global\let\@date\@empty
  \global\let\@title\@empty
  \global\let\title\relax
  \global\let\author\relax
  \global\let\date\relax
  \global\let\and\relax}

\renewcommand\@maketitle{%
  \begin{center}%
  \let \footnote \thanks
   \vspace*{0.5em}
    {\LARGE\bf \@title \par}%
    {\normalsize%
      \lineskip .5em%
      \vskip 2em%
      \begin{tabular}[t]{c}%
        \@author%
      \end{tabular}}%
  \end{center}}%
\makeatother

%---------------------------------------------------------------------------------------------

\newcommand{\address}[1]{%
  \begin{center}%
    \vskip -1em%
    \begin{center}%
      {\footnotesize #1}%
    \end{center}%
  \end{center}%
}%


%-----------------------------------------------------------------------------------

\renewenvironment{abstract}%
  {\small\vspace{0.5mm}%
   \list{}{\rightmargin 2em%
           \leftmargin 2em}%
    \item{}{\bf Abstract}\hspace*{0.5em}\relax}%
   {\endlist}


%-----------------------------------------------------------------------------------

\newenvironment{keyword}%
  {\small%
    \list{}{\rightmargin 2em%
           \leftmargin 2em}%
                \item{}{\bf Key~words}\hspace*{0.5em}\relax }%
       {\endlist%
        }%

\newenvironment{pacs}%
  {\small%
    \list{}{\rightmargin 2em%
           \leftmargin 2em}%
                \item{}{\bf PACS}\hspace*{0.5em}\relax }%
       {\endlist%
        \vskip 6mm}%


%---------------------------------------------------------------

\newcommand{\acknowledgments}[1]{%
   {\it #1}%
  }


\makeatletter

%--------------------\section, \subsection--------------------------------------------------------------

\renewcommand \thesection {\bf\@arabic\c@section}  

\renewcommand\section{\@startsection {section}{1}{\z@}%
                                    {5mm \@plus.2ex \@minus .2ex}%
                                   {5mm \@plus.2ex \@minus .2ex}%
                                   {\normalfont\large\bfseries}}
\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
                                   %  {-2.25ex\@plus -1ex \@minus -.2ex}%
                                     {1.5ex \@plus .2ex}%
                                     {1.5ex \@plus .2ex}%
                                     {\normalfont\bfseries}}

\renewcommand\subsubsection{\renewcommand \thesection {\@arabic\c@section}
                            \@startsection{subsubsection}{3}{\z@}%
                                   %  {-2.25ex\@plus -1ex \@minus -.2ex}%
                                     {0.5ex}%
                                     {0.5ex}%
                                     {\normalfont}}
                                     
                                     
%----------------------------------------------------------------------------------------------

\renewcommand{\@biblabel}[1]{#1}
\renewcommand\refname{{\normalsize\bf References}}
\renewenvironment{thebibliography}[1]
     {\noindent\refname%
      \@mkboth{\MakeUppercase\refname}{\MakeUppercase\refname}%
      \footnotesize
      \list{\@biblabel{\@arabic\c@enumiv}}%
           {\settowidth\labelwidth{\@biblabel{#1}}%
            \leftmargin\labelwidth
            \advance\leftmargin\labelsep
            \@openbib@code
            \usecounter{enumiv}%
            \let\p@enumiv\@empty
            \renewcommand\theenumiv{\@arabic\c@enumiv}}%
      %\sloppy
      %\setlength{\itemsep}{-1.5mm}
      \setlength{\itemsep}{0mm}
      \setlength{\labelsep}{0.8em}
      \setlength{\parsep}{0mm}
      \setlength{\parskip}{0mm}
      \setlength{\topsep}{0mm}
      \setlength{\partopsep}{0mm}
      \clubpenalty4000
      \@clubpenalty \clubpenalty
      \widowpenalty4000%
      \sfcode`\.\@m}
     {\def\@noitemerr
       {\@latex@warning{Empty `thebibliography' environment}}%
      \endlist}

%---------------------------------------------------------------------------------

\newenvironment{mylabc}
                {%
                 \small
                 \let\\\@centercr
                 \list{}{\itemsep      \z@
                         \itemindent   -1em%
                         \listparindent0em
                         \leftmargin   3em
                         \rightmargin  2em}
                         \item\relax}
                {\endlist}


\makeatother




\fancypagestyle{myfoot}
{%
\fancyhf{}
\fancyhead[l]{\hspace{0.5em}\footnotesize CPC(HEP \& NP), 2009, {\bf 33}(X): \thepage---\pageref{LastPage}}
\fancyhead[r]{\footnotesize Vol.\;33, No.\;X,~ Xxx,\;2009\hspace{0.5em}}
\fancyhead[c]{\qquad\large\bf Chinese Physics C }
\fancyfoot[l]{\footnotesize\hspace{3mm}\raisebox{0.3ex}{$\scriptsize\copyright$}2009\! 
Chinese Physical Society and the Institute of High
Energy Physics of the Chinese\! Academy of Sciences and the Institute
of Modern Physics of the Chinese Academy of Sciences and IOP Publishing Ltd}
\renewcommand{\headrule}{\vskip 2pt
\hrule height0.4pt width\headwidth \vskip1pt
\hrule height0.4pt width\headwidth \vskip-1.8pt}
}%
\thispagestyle{myfoot}
 
\pagestyle{fancy}
\fancyhead{}
\fancyhead[lo]{\footnotesize \hspace{0.5em}No.\;X\hspace{0.5em}}
\fancyhead[ro,le]{\footnotesize \hspace{0.5em}\thepage\hspace{0.5em}}
\fancyhead[ce]{\footnotesize Chinese Physics C (HEP \& NP)}
\fancyhead[re]{\footnotesize \hspace{0.5em}Vol.\;33\hspace{0.5em}}
\fancyfoot[ce,co]{}
\renewcommand{\headrule}{\vskip 2pt  \hrule height0.4pt width\headwidth}

\makeatletter

\newcommand\figcaption{\def\@captype{figure}\caption}
\newcommand\tabcaption{\def\@captype{table}\caption}
\renewcommand\figurename{Fig.}

\long\def\@makecaption#1#2{%
\vskip\abovecaptionskip
\sbox\@tempboxa{#1.\quad #2}%
\ifdim \wd\@tempboxa >\hsize
  \begin{mylabc}
  \vspace{-2mm}
  {\small #1.\quad #2}%
  \vskip 1mm%
  \end{mylabc}\par
\else
   \global \@minipagefalse
   \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
\fi
\vskip\belowcaptionskip}


\setcounter{page}{1}

\makeatother

%%
%% End of file `cpc-hepnp.cls'.
