%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \filename{mg9toc.tex} \version{6-jul-1995->25-oct-1996->5-sep-2000 ->1-aug-2001->5-dec-2001}
%     LaTeX file for generating table of contents and unsorted author/page
%     file.  Uses world scientific 9.75in x 6.5in latex(2e) proceedings style.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% CREATED in 1994 for MG7 by Robert T Jantzen.
% USED in 1997 for MG8.
% MODIFIED in 2000 for MG9.
% NOTES 2001:
% Since the web author entries were in the form:
%   Jantzen, Robert T.; Donato, Bini; Cherubini, Christian
% instead of as in the past:
%   Robert T. Jantzen, Donato Bini and Christian Cherubini
% the comma separator had to be replaced by the semicolon 
% to generate the unsorted author index data file.
% Because of the large number of authors, the interitem skip and bigitem
% skip amounts between article listings and preceding session titles
% were reduced.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\documentclass{ws-p9-75x6-50}

\typeout{***********}
\typeout{This file produces the table of contents for the MG9 
         proceedings.}
\typeout{***********}
\typeout{The page breaks must be checked by hand.}
\typeout{***********}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\typeout{*** front matter has roman pagenumbering after the titlepages}
\pagenumbering{roman}
 \setcounter{page}{21}

\font\smallcaps = cmcsc10
\font\smallcapstwelve = cmcsc10 scaled \magstep1
     \typeout{Use \smallcapstwelve if at twelvept.}

\parindent=0pt  % for left justification

\newcount\Pagecount \Pagecount=0
\def\thePagecount{%
      \ifnum\Pagecount<0 \rm\romannumeral-\Pagecount 
                         \else \rm\number\Pagecount \fi}

  \def\dotfill{\leaders\hbox to 1em{\hss.\hss}\hfill}
% \def\dotfill{\leaders\hbox to 1em{\hss.\hss}\hskip 5em plus 1 fil}
  \typeout{*** Adjust minimum dot leader length here}

\def\newline{\hfil\break}

\def\parfillskipright{\parfillskip=-\rightskipamount}
\def\rightskipon{\rightskip=\rightskipamount}
\def\rightskipoff{\rightskip=0pt}

\def\parfillskipoff{\parfillskip=0pt}
\def\parfillskipon{\parfillskip=0pt plus 1fil}

%\def\itemsep{.5\baselineskip}
\def\itemsep{4pt}   %%%%%%%%%%%%%%%%%%%%%%%% HERE IS THE INTERITEM SKIP
\def\sessionsep{\baselineskip}
%\def\bigitemsep{1.5\baselineskip}  % part, plenary sessions, etc 
\def\bigitemsep{1.5\baselineskip}  % part, plenary sessions, etc 
\def\rightskipamount{1in plus .25in}   % title wrap: amount from right margin

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% to write out a list of authors with pagenumbers:
\newwrite\authorfile
\immediate\openout\authorfile=mg9tocal.lis
     \typeout{OPENING file mg9tocal.lis: author, page index file}

%%%%%\null\eject\pageno=1  % to overcome initial write problem [not necessary]

%\immediate\write\authorfile{UNSORTED AUTHOR INDEX DATA:}

\def\closelist{\closeout\authorfile}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcount\papercount \papercount=0
\def\@{\advance\papercount by 1\beginitem}

%\def\lastfirst#1 #2 {#2, #1}

\def\beginitem#1\\ #2\\ #3\par{%
     \vskip\itemsep
     {\parfillskipon \rightskip=\rightskipamount\rm #1\par}%
%      \nobreak{\smallcaps #2}\null\nobreak\dotfill\thePagecount
       {\rightskipon \parfillskipright
        \nobreak{\smallcaps #2}\null\nobreak\dotfill\thePagecount
                                  \pagetag{#3}\par}
%%%%%%%% write to author file:
%     \immediate\write\authorfile{#2, \number\Pagecount}% 
%            \typeout{writing #2, \number\Pagecount}%
%              % write author, pageno to file mg9tocal.lis
%     \advance\Pagecount by #3}
%
      %\def\pgno{\number\Pagecount}\eachauthor #2,\eachauthor,%
      %          \advance\Pagecount by #3
      \def\pgno{\number\Pagecount}\eachauthor #2;\eachauthor;%
                \advance\Pagecount by #3
}

%\def\eachauthor#1,{\ifx\eachauthor#1\relax\else
\def\eachauthor#1;{\ifx\eachauthor#1\relax\else
 \toks0={#1}% prevent expansion of macros in author names
% \immediate\write\authorfile{\the\toks0, \pgno\string\\}%
%  \immediate\write\authorfile{\the\toks0, \pgno}%\string\\}%
  \immediate\write\authorfile{\the\toks0; \pgno}%\string\\}%
 \expandafter\eachauthor\fi}

\def\Jr{, Jr.}
\def\SJ{, S.J.}
\typeout{>>>>>>> USE \Jr for , Jr. and \SJ for , S.J. <<<<<<<<<<<<<<<}
\typeout{>>>>>>> USE optional hyphen \- to connect multiple last names <<<<<}
\def\-{\ } % used in author out file

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\pagenumberson{\footline={\hfill\rm\folio\hfill}
  \typeout{**** PAGENUMBERS TURNED ON TEMPORARILY}}
\def\pagetag#1{}

\def\proofsonly{%
  \pagenumberson
  \headline={\hfil COPY FOR CATALOGING MANUSCRIPTS\hfil}
   \def\pagetag##1{\rlap{\hbox to 2cm{\hfill\ninept \bf ##1}}}
   \typeout{**** PAGE counts in margin temporarily}
   \typeout{****************PROOF COPY ONLY!*****************}
 }
%\proofsonly
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\def\endsession{%
        \par
        \parfillskipon} % not needed now

\def\session#1#2{%
     \typeout{*** Session: #1}\typeout{Chairperson: #2}%
     \parfillskipon       % if set to zero pt
     \vskip\itemsep {\bf $\bullet$ #1}\hfil\break
     {\it Chairperson:\ #2}\par
     \ifodd\Pagecount \advance\Pagecount by 2\relax % chairpage odd 
                \else \advance\Pagecount by 3 \fi % extra page to make odd
     \parfillskipoff}

\def\beginfrontshortitem#1\\ #2\par{%
     \vskip\itemsep{\rm #1}\null\nobreak\dotfill\thePagecount
     \pagetag{#2}%
     \advance\Pagecount by -#2}%negative pagenumbers to generate roman numerals

\def\beginbackshortitem#1\\ #2\par{%
     \vskip\itemsep{\rm #1}\null\nobreak\dotfill\thePagecount
     \pagetag{#2}%
     \advance\Pagecount by #2}% positive pagenumbers at end

\def\endfrontmatter{%
     \typeout{** End FRONT MATTER}%
     \parfillskipon
     \Pagecount=1    %   page number for PLENARY SESSION page: 1
     \def\@{\advance\papercount by 1\beginitem}}

\def\Tableofcontents{%
     \typeout{Table of Contents}%
     \centerline{\bf TABLE OF CONTENTS}
     \parfillskipoff
     \Pagecount=-5   % first page number: v 
     \def\@{\beginfrontshortitem}}

\def\Part#1{%
     \typeout{** PART #1}%
     \vskip \bigitemsep
     \centerline{\bf\uppercase{PART #1}}}

\def\Plenarysessions{%
     \typeout{* Plenary sessions}%
     \vskip \bigitemsep
     \centerline{\bf\uppercase{PLENARY SESSIONS}}
%     \advance\Pagecount by 2 % PLENARY SESSION page plus blank 
%                             % taken care of by first \Plenarychair
      }

\def\Parallelsessions{%
     \typeout{* Parallel sessions}%
     \vskip \bigitemsep
     \centerline{\bf\uppercase{PARALLEL SESSIONS}}} 
% 2001 extra space:
     \vskip.5\baselineskip

\def\Reviewtalks{%
     \typeout{* Review talks}%
     \vskip \bigitemsep
     \centerline{\bf\uppercase{REVIEW TALKS}}} 
% 2001 extra space:
     \vskip.5\baselineskip

\def\Publictalks{%
     \typeout{* Public Talks}%
     \ifodd\Pagecount \advance\Pagecount by 2\relax % titlepage odd 
                \else \advance\Pagecount by 3 \fi % extra page to make odd
     \vskip \bigitemsep
     \centerline{\bf\uppercase{PUBLIC TALKS}}}

\def\Plenarychair#1{%
     \parfillskipon   % if set to zero pt
     \vskip \itemsep
     \hskip 20pt{\it Chairperson:\ #1}\par
     \ifodd\Pagecount \advance\Pagecount by 2\relax % chairpage odd 
                \else \advance\Pagecount by 3 \fi % extra page to make odd
     \parfillskipoff}

\typeout{Ten point fonts is the default}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% end macros %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\tracingcommands=1
\begin{document}

\Tableofcontents

\typeout{About 22 pages in Table of contents if 2 page preface}

\@
Publications in this Series\\
2

\@
Organizing Committees and Sponsors\\
2

\@
Marcel Grossmann Awards\\
2

\@
Preface\\
5

\@
Marcel Grossmann Award Talk: Cecile DeWitt-Morette\\
2

\@
Marcel Grossmann Award Talk: Jacques Solvay\\
2

\@
Marcel Grossmann Award Talk: Ilya Prigogine\\
3

\endfrontmatter

\typeout{20+preface+40toc = 60+toc}
\typeout{4 standard pages of front matter from publisher}
\typeout{10 + 36?(dedication) pages of front matter; photo?; opening addresses?}

\typeout{so  about 4 + (10+36) + 29 = 79 front matter pages about get repeated 
         in both volumes; back matter only in second volume}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\Part A

\typeout{Part B must be inserted by hand when break point decided.}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Plenarysessions

\input mg9plenaryparallel  % just one file this time

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\Parallelsessions

%\def\newline{}\typeout{*** newline disabled}

%\input mg9parallel

%\Publictalks
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\typeout{Forced New Page:}
%\vfill\eject
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\typeout{********* * * * Total number of contributed papers: \the\papercount.}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\typeout{These are estimates of the number of pages here: from mg7}

\def\@{\beginbackshortitem}

\vskip 24pt

\@
List of Participants\\
18

\@
Author Index\\
12

\typeout{Final page number plus 1 approximately: \number\Pagecount}

\closelist % close author list file

\end{document}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newpage

\section*{TO DO}

\begin{itemize}

\item
Order the plenary talks in some thought out way.

\item
Insert finished preface in mg9front.tex and correct page count in mg9toc.tex.

\item
Insert correct plenary information for final late submissions.

\item
Insert PART B macro at dividing point if TWO VOLUMES. THREE VOLUMES?

\end{itemize}