% Patch LaTeX's output routine to handle marks correctly with two columns.
% Joe Pallas <pallas@edu.stanford.neon>
% Corrected by Piet van Oostrum <piet@cs.ruu.nl> on Feb 5, 1993

\def\@outputdblcol{\if@firstcolumn \global\@firstcolumnfalse
% Remember the marks from the first column
    \global\setbox\@leftcolumn\vsplit\@outputbox to\ht\@outputbox
    \expandafter\gdef\expandafter\@firstcoltopmark\expandafter{\topmark}%
    \expandafter\gdef\expandafter\@firstcolfirstmark
                                \expandafter{\splitfirstmark}%
   \ifx\@firstcolfirstmark\empty\global\let\@setmarks\relax\else
    \gdef\@setmarks{\let\firstmark\@firstcolfirstmark
    	\let\topmark\@firstcoltopmark}%
   \fi
% End of change
  \else \global\@firstcolumntrue
    \setbox\@outputbox\vbox{\hbox to\textwidth{\hbox to\columnwidth
      {\box\@leftcolumn \hss}\hfil \vrule width\columnseprule\hfil
       \hbox to\columnwidth{\box\@outputbox \hss}}}\@combinedblfloats
% Override current first and top with those of first column if necessary
       \@setmarks
% End of change
       \@outputpage \begingroup \@dblfloatplacement \@startdblcolumn
       \@whilesw\if@fcolmade \fi{\@outputpage\@startdblcolumn}\endgroup
    \fi}

\def\toprightmark{\expandafter\@rightmark\topmark}
