Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ZhenwuLiu opened this issue Apr 9, 2022 · 4 comments

Comments

@ZhenwuLiu
Copy link

image

@MacsedProtoss
Copy link

same, looking for solutions

@MacsedProtoss
Copy link

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
Copy link

MacsedProtoss commented May 6, 2022

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

@zfengg
Copy link
Owner

zfengg commented Jun 10, 2022

image

请见 68b4dd4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants