HUSTtex icon indicating copy to clipboard operation
HUSTtex copied to clipboard

目录过多的话,就显示不完全,目录页只有一页,后面几章显示不出来

Open ZhenwuLiu opened this issue 2 years ago • 4 comments

image

ZhenwuLiu avatar Apr 09 '22 12:04 ZhenwuLiu

same, looking for solutions

MacsedProtoss avatar May 03 '22 17:05 MacsedProtoss

try add these after \usepackage{tocloft}

\makeatletter
\let\old@l@section\l@section
\renewcommand{\l@section}[2]{%
  \old@l@section{#1}{#2} % Regular setting of \section in ToC
  \pagebreak[0] % Add a zero penalty (for possible page break)
  \thispagestyle{main}
  }
\makeatother

MacsedProtoss avatar May 03 '22 17:05 MacsedProtoss

edit: you might need to add those codes to ensure page break works every single line

\makeatletter
\let\old@l@section\l@section
\renewcommand{\l@section}[2]{%
  \old@l@section{#1}{#2} % Regular setting of \section in ToC
  \pagebreak[0] % Add a zero penalty (for possible page break)
  \thispagestyle{main}
  }
\makeatother

\makeatletter
\let\old@l@subsection\l@subsection
\renewcommand{\l@subsection}[2]{%
  \old@l@subsection{#1}{#2} % Regular setting of \subsection in ToC
  \pagebreak[0] % Add a zero penalty (for possible page break)
  \thispagestyle{main}
  }
\makeatother

\makeatletter
\let\old@l@subsubsection\l@subsubsection
\renewcommand{\l@subsubsection}[2]{%
  \old@l@subsubsection{#1}{#2} % Regular setting of \subsubsection in ToC
  \pagebreak[0] % Add a zero penalty (for possible page break)
  \thispagestyle{main}
  }
\makeatother

\makeatletter
\let\old@l@paragraph\l@paragraph
\renewcommand{\l@paragraph}[2]{%
  \old@l@paragraph{#1}{#2} % Regular setting of \paragraph in ToC
  \pagebreak[0] % Add a zero penalty (for possible page break)
  \thispagestyle{main}
  }
\makeatother

MacsedProtoss avatar May 06 '22 02:05 MacsedProtoss

image

请见 68b4dd40b969f0ca5f23e2c0cd6cd8511605643f

zfengg avatar Jun 10 '22 15:06 zfengg