Skip to content

如何在目录中单独为某一章设置显示深度 #268

Closed Answered by atxy-blip
ret-1 asked this question in Q&A
Discussion options

You must be logged in to vote

需要在这一章前后加两行命令:

# 显示到 section 层级
\addtocontents{toc}{\protect\setcounter{tocdepth}{1}}
\chapter{foo}
...

# 恢复显示到 subsection 层级
\addtocontents{toc}{\protect\setcounter{tocdepth}{2}}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ret-1
Comment options

Answer selected by ret-1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
trick precious experience
2 participants