在一开始使用 multitoc,让目录分栏,但是 multitoc 抑制了 listoftables 的 generate ,有什么好的方法,让 multitoc 和 listoftables 同时起作用?
\documentclass{ctexbook}
\usepackage{tabularray}
\usepackage[toc]{multitoc}
\begin{document}
\listoftables\let\cleardoublepage\clearpage
\NewTblrTheme{fancy}{
\SetTblrStyle{firsthead}{font=\bfseries}
\SetTblrStyle{firstfoot}{fg=blue2}
\SetTblrStyle{middlefoot}{\itshape}
\SetTblrStyle{caption-tag}{red2}
}
\begin{longtblr}[
theme = fancy,
caption = {A Table},
entry = {Caption},
]{
colspec = {XXX}
}
Head & Head & Head \\
\end{longtblr}
\end{document}
得到如下效果:
\documentclass{ctexbook}
\usepackage{tabularray}
%\usepackage[toc]{multitoc}
\begin{document}
\listoftables\let\cleardoublepage\clearpage
\NewTblrTheme{fancy}{
\SetTblrStyle{firsthead}{font=\bfseries}
\SetTblrStyle{firstfoot}{fg=blue2}
\SetTblrStyle{middlefoot}{\itshape}
\SetTblrStyle{caption-tag}{red2}
}
\begin{longtblr}[
theme = fancy,
caption = {A Table},
entry = {Caption},
]{
colspec = {XXX}
}
Head & Head & Head \\
\end{longtblr}
\end{document}
得到如下效果:
很显然第二幅图才是想要的结果,但是却不得不注释掉 multitoc。
在 multitoc
宏包的问题,没有处理 false 分支的情况。
在它后面加上:
\makeatletter
\renewcommand*{\@starttoc}[1]{%
\ifthenelse{\boolean{@multitoc@toc}\and\equal{#1}{toc}}{%
\begin{multicols}{\multicolumntoc}%
\@multitoc@starttoc{#1}%
\end{multicols}%
}{%
\ifthenelse{\boolean{@multitoc@lot}\and\equal{#1}{lot}}{%
\begin{multicols}{\multicolumnlot}%
\@multitoc@starttoc{#1}%
\end{multicols}%
}{%
\ifthenelse{\boolean{@multitoc@lof}\and\equal{#1}{lof}}{%
\begin{multicols}{\multicolumnlof}%
\@multitoc@starttoc{#1}%
\end{multicols}%
}{\@multitoc@starttoc{#1}}%
}}}
\makeatother
我测试的代码正常,看看 multitoc 的说明:
\documentclass{ctexbook}
\usepackage{tabularray}
\usepackage[lot]{multitoc}
\begin{document}
\listoftables\let\cleardoublepage\clearpage
\NewTblrTheme{fancy}{
\SetTblrStyle{firsthead}{font=\bfseries}
\SetTblrStyle{firstfoot}{fg=blue2}
\SetTblrStyle{middlefoot}{\itshape}
\SetTblrStyle{caption-tag}{red2}
}
\begin{longtblr}[
theme = fancy,
caption = {A Table},
entry = {Caption},
]{
colspec = {XXX}
}
Head & Head & Head \\
\end{longtblr}
\end{document}
使用
lot
会让\listoftables
输出多栏。multitoc
没有解决\tableofcontents
输出多栏,但\listoftables
和\listoffigures
输出一栏的情况。@u10307 OK了。
得到如下结果:
也就是有了 listoftables ,ctexbook 中的 openright 不起作用?