\iflinks \write\tocfile{#1{\folio}}\fi
}
-% Finish up the main text and prepare to read what we've written
-% to \tocfile.
\newskip\contentsrightmargin \contentsrightmargin=1in
\newcount\savepageno
+\newcount\lastnegativepageno \lastnegativepageno = -1
+
+% Finish up the main text and prepare to read what we've written
+% to \tocfile.
+%
\def\startcontents#1{%
% If @setchapternewpage on, and @headings double, the contents should
% start on an odd page, unlike chapters. Thus, we maintain
\advance\hsize by -\contentsrightmargin % Don't use the full line length.
%
% Roman numerals for page numbers.
- \ifnum \pageno>0 \pageno = -1 \fi
+ \ifnum \pageno>0 \pageno = \lastnegativepageno \fi
}
\fi
\vfill \eject
\endgroup
+ \lastnegativepageno = \pageno
\pageno = \savepageno
}
\fi
\vfill \eject
\endgroup
+ \lastnegativepageno = \pageno
\pageno = \savepageno
}
\let\shortcontents = \summarycontents