Skip to content

Commit

Permalink
Fix empty lof when toc-depth set in preamble
Browse files Browse the repository at this point in the history
  • Loading branch information
zepinglee committed Oct 3, 2022
1 parent 0281b91 commit b95135e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
### Fixed

- 修正答辩委员会名单页的行距。
- 修复导言区中设置 `toc-depth` 导致空白插图清单的 bug。

## [v7.3.0] - 2022-05-17

Expand Down
19 changes: 14 additions & 5 deletions thuthesis.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -5968,11 +5968,15 @@
% 造成 \env{survey} 的子目录中 |tocdepth| 为 0。
% \begin{macrocode}
\thu@option@hook{toc-depth}{%
\protected@write\@auxout{}{%
\string\ttl@writefile{toc}{%
\protect\setcounter{tocdepth}{\thu@toc@depth}%
\ifx\@begindocumenthook\@undefined
\protected@write\@auxout{}{%
\string\ttl@writefile{toc}{%
\protect\setcounter{tocdepth}{\thu@toc@depth}%
}%
}%
}%
\else
\setcounter{tocdepth}{\thu@toc@depth}%
\fi
}
\g@addto@macro\appendix{%
\thusetup{
Expand All @@ -5993,7 +5997,7 @@
default = false,
},
}
\g@addto@macro\appendix{%
\thu@option@hook{appendix-figure-in-lof}{%
\ifthu@appendix@figure@in@lof@true
\addtocontents{lof}{\string\let\string\contentsline\string\ttl@contentsline}%
\addtocontents{lot}{\string\let\string\contentsline\string\ttl@contentsline}%
Expand All @@ -6004,6 +6008,11 @@
\addtocontents{loe}{\string\let\string\contentsline\string\ttl@gobblecontents}%
\fi
}
\g@addto@macro\appendix{%
\thusetup{
appendix-figure-in-lof = false,
}%
}
% \end{macrocode}
%
% 本科生《写作指南》有独特的要求:附录 A 为外文资料的调研阅读报告或书面翻译,
Expand Down

0 comments on commit b95135e

Please sign in to comment.