% ieee_tns.sty
%
% LaTeX 2e style file for IEEE Transactions on Nuclear Science
%
% Author: Marc Mengel <mengel@fnal.gov>
%

\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\RequirePackage{ifthen}
\RequirePackage{times}[1995/08/06]
\ProvidesPackage{ieee_tns}[1998/03/12 IEEE Transactions on Nuclear Science Style]

% Title/Author layout
\renewcommand\maketitle{%
	\twocolumn [%
	    \begin{center} 
	    {\Large \@title}\\%
	    \vspace{0.25in}
	    {%
	        \let\mynewline=\\
		\def\and{\mynewline\large}
		\def\\{\mynewline\normalsize}
	    	\large \@author
	    }\\%
	    \vspace{2pt}
	    \end{center} %
	] %
	\@thanks %
}
%
% Ten point text/ 12 point spacing
\normalsize
%
% paragraph layout, 3/16 indent, even after headings
\setlength{\parindent}{0.1875in}
\setlength{\parskip}{4pt plus 0.1pt minus 0.1pt}
\setlength{\belowdisplayskip}{0.1pt}
\setlength{\belowdisplayshortskip}{0.1pt}
\renewcommand{\@afterindentfalse}{}
%
% footnotes in 9pt
\renewcommand{\footnotesize}{\small}
%
%  hyphenation strongly discouraged.
\hyphenpenalty=10000
\emergencystretch=0.75in
% no page numbers
\pagestyle{empty}
%\flushbottom
%
% page layout, 3.5x9.5in columns, 0.17in apart, centered
% was:

\setlength{\textheight}{9.5in}
\setlength{\columnsep}{0.17in}
% two 3.5 columns + 0.17 spacing
\setlength{\textwidth}{7.17in}
%\renewcommand{\baselinestretch}{0.99}

\ifthenelse{\lengthtest{\paperheight=11in}}{%
\typeout{Laying out for letter paper}
\setlength{\oddsidemargin}{-0.33in}
\setlength{\evensidemargin}{-0.33in}
\setlength{\topmargin}{-0.24in}
}{%
\typeout{Laying out for a4 paper}
\setlength{\oddsidemargin}{-0.45in}
\setlength{\evensidemargin}{-0.45in}
\setlength{\topmargin}{0.11in}
}

\setlength{\headheight}{0in}
\setlength{\headsep}{0in}
\setlength{\footskip}{0in}
\setlength{\textfloatsep}{0in}
\setlength{\intextsep}{0in}
%
% sections numbered capital roman, subsections numbered capital letters
\renewcommand\thesection       {\Roman{section}}
\newcommand\thesepsection	{.\ \ }
\renewcommand\thesubsection    {\Alph{subsection}}
\newcommand\thesepsubsection	{.\ \ }
\renewcommand\thesubsubsection {\arabic{subsubsection}}
\newcommand\thesepsubsubsection	{)\ \ }
%
% separators are dots for everything but subsubsections which use parens
%
\def\@seccntformat#1{\csname the#1\endcsname\csname thesep#1\endcsname}
%
% sections centered, 12pt, subsections left italic 12pt
\renewcommand{\section}{%
    %\vspace{12pt} % -- why doesnt this work?
    \@startsection{section}{1}{\z@}%
			   {-0.1pt}% 
			   {0.1pt}%
			   {\reset@font\center\large\scshape}%
}

\renewcommand{\subsection}{%
     \vspace{5pt}
     \@startsection{subsection}{2}{\z@}%
			   {0.1pt}%
			   {0.1pt}%
			   {\reset@font\large\itshape}%
}
\renewcommand{\subsubsection}{%
    \vspace{1pt}
   \@startsection{subsubsection}{3}{\z@}%
			   {0.1pt}%
			   {0.1pt}%
			   {\reset@font\normalsize\itshape}%
}
% abstract italic
\renewenvironment{abstract}{{\section*{{\it Abstract}}}}{\vspace{0.1pt}}
%
% Figures called "Figure n" and table captions with 'Table n" on separate line
\renewcommand\figurename{Figure}
%
% captions 9pt
\renewcommand{\@makecaption}[2]{%
	\ifthenelse{\equal{\@captype}{table}}{%
		\small \begin{center}%
		\ \\\ \\#1\\#2\\[0pt]\vspace*{-6pt}%
		\end{center}%
	}{%
		\small #1:\ \  #2 \\
	}%
}
%
% Figures and tables go inline, not at top or bottom of page
% by default
%
\renewcommand{\fps@table}{h!}
\renewcommand{\fps@figure}{h!}
%
% Bibliography Style (stock LaTeX 2e only \small and zero \itemsep)
%
\renewenvironment{thebibliography}[1]{%
    \section{References}%
    % \small%
    \list{\@biblabel{\arabic{enumiv}}}%
         {  \setlength{\parsep}{0in}%
	    \setlength{\itemsep}{0in}%
	    \settowidth\labelwidth{\@biblabel{#1}}%
            \leftmargin\labelwidth
            \advance\leftmargin\labelsep
            \usecounter{enumiv}%
            \let\p@enumiv\@empty
            \renewcommand\theenumiv{\arabic{enumiv}}}%
        \renewcommand\newblock{\hskip .11em \@plus.33em \@minus.07em}%
      \sloppy\clubpenalty4000\widowpenalty4000%
      \sfcode`\.=\@m}
     {\def\@noitemerr
       {\@latex@warning{Empty `thebibliography' environment}}%
      \endlist}
%
% allow *lots* of figures
\setcounter{totalnumber}{16}
\setcounter{topnumber}{3}
\setcounter{bottomnumber}{3}
\setcounter{dbltopnumber}{3}
\renewcommand{\textfraction}{0.1}
\renewcommand{\topfraction}{0.9}
\renewcommand{\bottomfraction}{0.9}
\renewcommand{\dbltopfraction}{0.9}